aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Task.py
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2008-12-08 16:08:50 +0100
committerghost <andreas.monzner@multimedia-labs.de>2008-12-08 16:08:50 +0100
commit6df771b5f7e744c650b73f8548ab41152c0185eb (patch)
tree2c6ba8d941652209b355b868f91e1bdd339e172f /lib/python/Components/Task.py
parent5b37109a8002420247a5abf46841c95365e88036 (diff)
parentf1b8049d3735b3f6544e84817e9c7d3bca474d5e (diff)
downloadenigma2-6df771b5f7e744c650b73f8548ab41152c0185eb.tar.gz
enigma2-6df771b5f7e744c650b73f8548ab41152c0185eb.zip
Merge branch 'master' into dvd_scale_test
Diffstat (limited to 'lib/python/Components/Task.py')
-rw-r--r--lib/python/Components/Task.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py
index 9a768425..04e5c938 100644
--- a/lib/python/Components/Task.py
+++ b/lib/python/Components/Task.py
@@ -127,6 +127,7 @@ class Task(object):
self.cmd = None
self.cwd = "/tmp"
self.args = [ ]
+ self.cmdline = None
self.task_progress_changed = None
self.output_line = ""
job.addTask(self)
@@ -141,6 +142,9 @@ class Task(object):
self.global_preconditions.append(ToolExistsPrecondition())
self.postconditions.append(ReturncodePostcondition())
+ def setCmdline(self, cmdline):
+ self.cmdline = cmdline
+
def checkPreconditions(self, immediate = False):
not_met = [ ]
if immediate:
@@ -166,13 +170,15 @@ class Task(object):
self.container.stdoutAvail.append(self.processStdout)
self.container.stderrAvail.append(self.processStderr)
- assert self.cmd is not None
- assert len(self.args) >= 1
-
if self.cwd is not None:
self.container.setCWD(self.cwd)
- print "execute:", self.container.execute(self.cmd, *self.args), self.cmd, self.args
+ if not self.cmd and self.cmdline:
+ print "execute:", self.container.execute(self.cmdline), self.cmdline
+ else:
+ assert self.cmd is not None
+ assert len(self.args) >= 1
+ print "execute:", self.container.execute(self.cmd, *self.args), ' '.join(self.args)
if self.initial_input:
self.writeInput(self.initial_input)