From: Felix Domke Date: Wed, 27 Apr 2005 02:32:56 +0000 (+0000) Subject: - actionmap component will not catch (wrong) exceptions anymore X-Git-Tag: 2.6.0~5897 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/ec6cfceaa66fc2243e08001178c70fb5db9fcc50?hp=da40b2aac3c7b8efdc9061aadf9038306f44789c - actionmap component will not catch (wrong) exceptions anymore - fixed scan error handling when scan failed to start --- diff --git a/components.py b/components.py index 93e4b07d..de5d6d24 100644 --- a/components.py +++ b/components.py @@ -378,12 +378,12 @@ class ServiceScan: Error = 4 Errors = { + 0: "error starting scanning", 1: "error while scanning", 2: "no resource manager", 3: "no channel list" } - - + def scanStatusChanged(self): if self.state == self.Running: self.progressbar.setValue(self.scan.getProgress()) @@ -414,8 +414,10 @@ class ServiceScan: def execBegin(self): self.scan.statusChanged.get().append(self.scanStatusChanged) self.state = self.Running - if self.scan.start(): + err = self.scan.start() + if err: self.state = self.Error + self.errorcode = 0 self.scanStatusChanged() @@ -446,9 +448,9 @@ class ActionMap: def action(self, context, action): print " ".join(("action -> ", context, action)) - try: + if self.actions.has_key(action): self.actions[action]() - except KeyError: + else: print "unknown action %s/%s! typo in keymap?" % (context, action) class PerServiceDisplay(GUIComponent, VariableText): @@ -527,3 +529,4 @@ class ServiceName(PerServiceDisplay): def stopEvent(self): self.setText(""); +