git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17f0a48
)
make workspace a Job property, fix preconditions, Task will automatically add to...
author
Felix Domke
<tmbinc@elitedvb.net>
Tue, 20 May 2008 00:40:57 +0000
(
00:40
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Tue, 20 May 2008 00:40:57 +0000
(
00:40
+0000)
lib/python/Components/Task.py
patch
|
blob
|
history
diff --git
a/lib/python/Components/Task.py
b/lib/python/Components/Task.py
index fe81005b5dae1b5565701aa2c45ab2e5694d36b7..0441e00e5b2cacd9d72894a88b69ae308817f870 100644
(file)
--- a/
lib/python/Components/Task.py
+++ b/
lib/python/Components/Task.py
@@
-7,6
+7,7
@@
class Job:
NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4)
def __init__(self, name):
self.tasks = [ ]
NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4)
def __init__(self, name):
self.tasks = [ ]
+ self.workspace = "/tmp"
self.current_task = 0
self.callback = None
self.name = name
self.current_task = 0
self.callback = None
self.name = name
@@
-24,6
+25,7
@@
class Job:
return None
def addTask(self, task):
return None
def addTask(self, task):
+ task.job = self
self.tasks.append(task)
def start(self, callback):
self.tasks.append(task)
def start(self, callback):
@@
-53,17
+55,18
@@
class Job:
self.runNext()
class Task:
self.runNext()
class Task:
- def __init__(self, name):
+ def __init__(self,
job,
name):
self.name = name
self.name = name
- self.workspace = "/tmp"
self.immediate_preconditions = [ ]
self.global_preconditions = [ ]
self.postconditions = [ ]
self.returncode = None
self.initial_input = None
self.immediate_preconditions = [ ]
self.global_preconditions = [ ]
self.postconditions = [ ]
self.returncode = None
self.initial_input = None
+ self.job = None
self.cmd = None
self.args = [ ]
self.cmd = None
self.args = [ ]
+ job.addTask(self)
def setCommandline(self, cmd, args):
self.cmd = cmd
def setCommandline(self, cmd, args):
self.cmd = cmd
@@
-87,10
+90,11
@@
class Task:
return not_met
def run(self, callback):
return not_met
def run(self, callback):
- failed_preconditions = self.checkPreconditions(True)
+ failed_preconditions = self.checkPreconditions(True)
+ self.checkPreconditions(False)
if len(failed_preconditions):
if len(failed_preconditions):
-
err
back(failed_preconditions)
+
call
back(failed_preconditions)
return
return
+ self.prepare()
self.callback = callback
from enigma import eConsoleAppContainer
self.callback = callback
from enigma import eConsoleAppContainer