- actionmap component will not catch (wrong) exceptions anymore
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 27 Apr 2005 02:32:56 +0000 (02:32 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 27 Apr 2005 02:32:56 +0000 (02:32 +0000)
 - fixed scan error handling when scan failed to start

components.py

index 93e4b07d9a76393875794fbacd2f538f06961d04..de5d6d24605dd92c0b45928db1eae5d0702ad9f2 100644 (file)
@@ -378,12 +378,12 @@ class ServiceScan:
        Error = 4
        
        Errors = { 
        Error = 4
        
        Errors = { 
+               0: "error starting scanning",
                1: "error while scanning",
                2: "no resource manager",
                3: "no channel list"
                }
                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())
        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
        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.state = self.Error
+                       self.errorcode = 0
 
                self.scanStatusChanged()
        
 
                self.scanStatusChanged()
        
@@ -446,9 +448,9 @@ class ActionMap:
        
        def action(self, context, action):
                print " ".join(("action -> ", context, action))
        
        def action(self, context, action):
                print " ".join(("action -> ", context, action))
-               try:
+               if self.actions.has_key(action):
                        self.actions[action]()
                        self.actions[action]()
-               except KeyError:
+               else:
                        print "unknown action %s/%s! typo in keymap?" % (context, action)
 
 class PerServiceDisplay(GUIComponent, VariableText):
                        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("");
        
        def stopEvent(self):
                        self.setText("");
+