fix singleton invocation of pipeline

This commit is contained in:
Adrian Sampson 2011-04-17 13:35:00 -07:00
parent 3a5f9ecb38
commit 1b3e7d9310

View file

@ -356,11 +356,14 @@ def user_query(config):
if choice is action.TRACKS:
# Set up a little pipeline for dealing with the singletons.
item_tasks = []
def emitter():
for item in task.items:
yield ImportTask.item_task(item)
def collector():
while True:
item_task = yield
item_tasks.append(item_task)
ipl = pipeline.Pipeline((iter(task.items), item_lookup(config),
ipl = pipeline.Pipeline((emitter(), item_lookup(config),
item_query(config), collector()))
ipl.run_sequential()
task = pipeline.multiple(item_tasks)