X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FConsole.py;h=c5fa5f9810456c3ec051e4146c3edeb3e3f46ca8;hp=c451eba79914e1acc43d94deec25e2166862e40f;hb=6bb94cd5b0d8fd3608afe84e8d76aef554a4b401;hpb=1b01c9c3c05fdd42327406161bd5c51e05fbca19 diff --git a/lib/python/Components/Console.py b/lib/python/Components/Console.py index c451eba..c5fa5f9 100644 --- a/lib/python/Components/Console.py +++ b/lib/python/Components/Console.py @@ -25,6 +25,21 @@ class Console(object): if retval: self.finishedCB(name, retval) + def eBatch(self, cmds, callback, extra_args=[], debug=False): + self.debug = debug + cmd = cmds.pop(0) + self.ePopen(cmd, self.eBatchCB, [cmds, callback, extra_args]) + + def eBatchCB(self, data, retval, _extra_args): + (cmds, callback, extra_args) = _extra_args + if self.debug: + print '[eBatch] retval=%s, cmds left=%d, data:\n%s' % (retval, len(cmds), data) + if len(cmds): + cmd = cmds.pop(0) + self.ePopen(cmd, self.eBatchCB, [cmds, callback, extra_args]) + else: + callback(extra_args) + def dataAvailCB(self, name, data): self.appResults[name] += data