Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
pipelet
Pipelet
Commits
4e3b87ab
Commit
4e3b87ab
authored
Feb 10, 2011
by
Betoule Marc
Browse files
Try to come up with a glob_seg working properly for segments without tasks
parent
f0ab83ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
pipelet/environment.py
pipelet/environment.py
+6
-3
pipelet/task.py
pipelet/task.py
+0
-2
pipelet/tracker.py
pipelet/tracker.py
+4
-4
No files found.
pipelet/environment.py
View file @
4e3b87ab
...
...
@@ -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
()
res
=
[]
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
]:
res
+=
glob
(
path
.
join
(
self
.
_worker
.
pipe
.
get_data_dir
(
segx
),
t
,
y
))
if
not
str_parents
[
segx
]:
res
+=
glob
(
path
.
join
(
self
.
_worker
.
pipe
.
get_data_dir
(
segx
),
y
))
else
:
for
t
in
str_parents
[
segx
]:
res
+=
glob
(
path
.
join
(
self
.
_worker
.
pipe
.
get_data_dir
(
segx
),
t
,
y
))
return
res
def
glob_seg_all
(
self
,
x
,
y
):
...
...
pipelet/task.py
View file @
4e3b87ab
...
...
@@ -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
else
:
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
]
...
...
pipelet/tracker.py
View file @
4e3b87ab
...
...
@@ -329,14 +329,14 @@ class SqliteTracker(Tracker,threading.Thread):
t
.
id
=
c
.
lastrowid
logger
.
debug
(
'for task:
\n
%s
\n
parents:
\n
%s
\n
'
%
(
str
(
t
),
str
(
t
.
parents
)))
self
.
conn
.
executemany
(
'insert into task_relations (father_id, child_id) values (?, ?)'
,((
fid
,
t
.
id
)
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
]]
try
:
t
.
str_parents
[
s
].
append
(
e
[
1
])
except
KeyError
:
t
.
str_parents
[
s
]
=
[
e
[
1
]]
t
.
str_parents
[
s
].
append
(
e
[
1
])
return
t
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment