From 8f1d65ef0dce2103c1f2d1a949474ea37b7a7c67 Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Sat, 26 Sep 2009 21:36:21 +0000 Subject: [PATCH] cleanup --- autotimer/src/plugin.py | 2 +- epgsearch/src/plugin.py | 11 +++++------ tageditor/src/plugin.py | 2 +- webinterface/src/WebComponents/Sources/MP.py | 2 +- webinterface/src/WebComponents/Sources/Timer.py | 12 ++++++------ 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/autotimer/src/plugin.py b/autotimer/src/plugin.py index bf095f7a..fef536c6 100644 --- a/autotimer/src/plugin.py +++ b/autotimer/src/plugin.py @@ -60,7 +60,7 @@ def autostart(reason, **kwargs): # We re-read the config so we won't save wrong information try: autotimer.readXml() - except: + except Exception: # XXX: we should at least dump the error pass diff --git a/epgsearch/src/plugin.py b/epgsearch/src/plugin.py index f8ab43df..0c2e5067 100644 --- a/epgsearch/src/plugin.py +++ b/epgsearch/src/plugin.py @@ -19,12 +19,11 @@ from Plugins.Plugin import PluginDescriptor # Autostart def autostart(reason, **kwargs): - if "session" in kwargs: - try: - # for blue key activating in EPGSelection - EPGSelectionInit() - except: - pass + try: + # for blue key activating in EPGSelection + EPGSelectionInit() + except Esception: + pass # Mainfunction def main(session, *args, **kwargs): diff --git a/tageditor/src/plugin.py b/tageditor/src/plugin.py index b312a8d7..717d1065 100644 --- a/tageditor/src/plugin.py +++ b/tageditor/src/plugin.py @@ -20,7 +20,7 @@ def Plugins(**kwargs): try: from Screens.MovieSelection import setPreferredTagEditor setPreferredTagEditor(TagEditor) - except: + except Exception: pass return PluginDescriptor(name = "TagEditor", description = _("edit tags..."), where = PluginDescriptor.WHERE_MOVIELIST, fnc = main) diff --git a/webinterface/src/WebComponents/Sources/MP.py b/webinterface/src/WebComponents/Sources/MP.py index 86817a86..d7c228fd 100644 --- a/webinterface/src/WebComponents/Sources/MP.py +++ b/webinterface/src/WebComponents/Sources/MP.py @@ -34,7 +34,7 @@ class MP(Source): try: test = len(self.session.mediaplayer.playlist) return True - except: + except Exception: pass # Link inactive, instantiate new MP diff --git a/webinterface/src/WebComponents/Sources/Timer.py b/webinterface/src/WebComponents/Sources/Timer.py index 4ff7aa27..2eeaae9a 100644 --- a/webinterface/src/WebComponents/Sources/Timer.py +++ b/webinterface/src/WebComponents/Sources/Timer.py @@ -91,7 +91,7 @@ class Timer(Source): if str(timer.service_ref) == str(service_ref) and int(timer.begin) == begin and int(timer.end) == end: self.recordtimer.removeEntry(timer) return True, "The timer '%s' has been deleted successfully" % (timer.name) - except: + except Exception: return ( False, "The timer has NOT been deleted" ) return False, "No matching Timer found" @@ -173,7 +173,7 @@ class Timer(Source): try: service = self.session.nav.getCurrentService() event = service.info().getEvent(0) - except: + except Exception: print "[Webcomponents.Timer] recordNow Exception!" begin = time() @@ -317,7 +317,7 @@ class Timer(Source): self.session.nav.RecordTimer.timeChanged(timer) print "[WebComponents.Timer] editTimer: Timer changed!" return ( True, "Timer %s has been changed!" % (timer.name) ) - except: + except Exception: #obviously some value was not good, return an error return ( False, "Changing the timer for '%s' failed!" % name ) @@ -332,7 +332,7 @@ class Timer(Source): #add the new timer self.recordtimer.record(timer) return ( True, "Timer added successfully!" ) - except: + except Exception: #something went wrong, most possibly one of the given paramater-values was wrong return ( False, "Could not add timer '%s'!" % name ) @@ -415,12 +415,12 @@ class Timer(Source): try: timer.append(item.Filename) - except: + except AttributeError: timer.append("") try: timer.append(item.next_activation) - except: + except AttributeError: timer.append("") if item.eit is not None: -- 2.20.1