Commit 4e3b87ab authored by Betoule Marc's avatar Betoule Marc
Browse files

Try to come up with a glob_seg working properly for segments without tasks

parent f0ab83ab
......@@ -199,14 +199,17 @@ class Environment(EnvironmentBase):
str_parents = self._worker.task.str_parents
if segs is None:
segs = str_parents.keys
segs = str_parents.keys()
for x in segs:
segx = self._worker.pipe.find_seg(self._worker.task.seg, x)
if segx is None:
self.logger.warning("No parent segment matching %s found"%x)
for t in str_parents[segx]:
if not str_parents[segx]:
for t in str_parents[segx]:
return res
def glob_seg_all(self, x, y):
......@@ -172,11 +172,9 @@ class TaskList:
if directive.where:
f = multiplex._where(parent_list, directive.where)
output_set = filter(f, output_set)
if directive.group_by:
output_set = multiplex._group(output_set, parent_list, directive.group_by)
lst_task = [Task(seg, e[0], status='queued', parents=list(set(e[1]))) for e in output_set]
## make the list of task to push, input are dictionnaries
lst_task = [Task(seg, make_dict([(r[2],r[0]) for r in e]), status='queued', parents=list(set([r[1] for r in e if r[1] is not None]))) for e in output_set]
......@@ -329,14 +329,14 @@ class SqliteTracker(Tracker,threading.Thread): = c.lastrowid
logger.debug('for task:\n%s\nparents:\n%s\n'%(str(t),str(t.parents)))
self.conn.executemany('insert into task_relations (father_id, child_id) values (?, ?)',((fid, for fid in t.parents))
for p in self.pipe.get_parents(t.seg):
t.str_parents[p] = []
for fid in t.parents:
c = self.conn.execute('select seg_id, str_input from tasks where task_id=?', ((fid,)))
for e in c:
s = self.seg_name_cache[e[0]]
except KeyError:
t.str_parents[s] = [e[1]]
return t
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment