allow callback-less ePopen
authorFraxinas <andreas.frisch@multimedia-labs.de>
Thu, 4 Dec 2008 10:18:09 +0000 (11:18 +0100)
committerFraxinas <andreas.frisch@multimedia-labs.de>
Thu, 4 Dec 2008 10:18:09 +0000 (11:18 +0100)
lib/python/Components/Console.py

index c5fa5f9..136d10d 100644 (file)
@@ -8,7 +8,7 @@ class Console(object):
                self.callbacks = {}
                self.extra_args = {}
 
                self.callbacks = {}
                self.extra_args = {}
 
-       def ePopen(self, cmd, callback, extra_args=[]):
+       def ePopen(self, cmd, callback=None, extra_args=[]):
                name = cmd
                i = 0
                while self.appContainers.has_key(name):
                name = cmd
                i = 0
                while self.appContainers.has_key(name):
@@ -50,5 +50,6 @@ class Console(object):
                extra_args = self.extra_args[name]
                del self.appContainers[name]
                del self.extra_args[name]
                extra_args = self.extra_args[name]
                del self.appContainers[name]
                del self.extra_args[name]
-               self.callbacks[name](data,retval,extra_args)
+               if self.callbacks[name]:
+                       self.callbacks[name](data,retval,extra_args)
                del self.callbacks[name]
                del self.callbacks[name]