Skip to content

Commit

Permalink
improve exception handling #619
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel committed Aug 5, 2017
1 parent 651b189 commit 8ba393c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions plugin/controllers/AT.py
Expand Up @@ -20,7 +20,7 @@ def __init__(self, session, path = ""):
AutoTimerRemoveAutoTimerResource, AutoTimerSettingsResource, \
AutoTimerSimulateResource
except ImportError:
print "AT plugin not found"
#print "AT plugin not found"
return
self.putChild('parse', AutoTimerDoParseResource())
self.putChild('remove', AutoTimerRemoveAutoTimerResource())
Expand All @@ -32,6 +32,7 @@ def __init__(self, session, path = ""):
from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerTestResource
self.putChild('test', AutoTimerTestResource())
except ImportError:
# this is not an error
pass

def render(self, request):
Expand All @@ -45,7 +46,6 @@ def render(self, request):
autotimer.readXml()
return ''.join(autotimer.getXml())
except Exception:
pass
return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Config not found</e2statetext></e2simplexmlresult>'
return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Config not found</e2statetext></e2simplexmlresult>'
except ImportError:
return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Plugin not found</e2statetext></e2simplexmlresult>'
6 changes: 3 additions & 3 deletions plugin/controllers/ajax.py
Expand Up @@ -249,21 +249,21 @@ def P_multiepg(self, request):
try:
week = int(request.args["week"][0])
wadd = week * 7
except Exception, e:
except ValueError:
pass
if "day" in request.args.keys():
try:
day = int(request.args["day"][0])
if day > 0 or wadd > 0:
now = localtime()
begintime = mktime( (now.tm_year, now.tm_mon, now.tm_mday+day + wadd, 0, 0, 0, -1, -1, -1) )
except Exception, e:
except ValueError:
pass
mode = 1
if config.OpenWebif.webcache.mepgmode.value:
try:
mode = int(config.OpenWebif.webcache.mepgmode.value)
except Exception, e:
except ValueError:
pass
epg = getMultiEpg(self, bref, begintime, endtime, mode)
epg['bouquets'] = bouq['bouquets']
Expand Down

0 comments on commit 8ba393c

Please sign in to comment.