cc-2055: switch-to-init.d
-return proper return value when exception is raised in recorder.py
This commit is contained in:
parent
bfb5dc4e58
commit
48e05e4b7f
2 changed files with 12 additions and 14 deletions
|
@ -318,6 +318,7 @@ class AirTimeApiClient(ApiClientInterface):
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.error("Exception: %s", e)
|
logger.error("Exception: %s", e)
|
||||||
|
response = None
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
|
@ -166,21 +166,18 @@ class Record():
|
||||||
|
|
||||||
def get_shows(self):
|
def get_shows(self):
|
||||||
|
|
||||||
shows = self.api_client.get_shows_to_record()
|
response = self.api_client.get_shows_to_record()
|
||||||
|
|
||||||
if self.sr is not None:
|
|
||||||
if not shows['is_recording'] and self.sr.is_recording():
|
|
||||||
self.sr.cancel_recording()
|
|
||||||
|
|
||||||
|
|
||||||
if shows is not None:
|
|
||||||
shows = shows[u'shows']
|
|
||||||
else:
|
|
||||||
shows = []
|
|
||||||
|
|
||||||
if len(shows):
|
if response is not None and 'is_recording' in response:
|
||||||
self.process_shows(shows)
|
if self.sr is not None:
|
||||||
self.check_record()
|
if not response['is_recording'] and self.sr.is_recording():
|
||||||
|
self.sr.cancel_recording()
|
||||||
|
|
||||||
|
shows = response[u'shows']
|
||||||
|
|
||||||
|
if len(shows):
|
||||||
|
self.process_shows(shows)
|
||||||
|
self.check_record()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue