Every line starting with "|| " is treated as a work item.
- Return a list of ('item', 'status') pairs.
+ Return a list of ('item', 'status', 'assignee') tuples.
'''
result = []
for line in urllib.urlopen(url):
+ assignee = 'nobody'
if line.startswith('|| '):
fields = line.strip().split('||')
assert not fields[0] # should be empty
desc = fields[1].strip()
for f in fields[2:]:
- if 'DONE' in f:
- result.append((desc, 'done'))
- break
- elif 'POSTPONED' in f:
- result.append((desc, 'done'))
- break
+ if 'DONE' in f or 'POSTPONED' in f or 'TODO' in f or 'INPROGRESS' in f:
+ ff = f.split()
+ if len(ff) == 2:
+ assignee = ff[1]
+ if 'DONE' in f:
+ result.append((desc, 'done', assignee))
+ break
+ elif 'POSTPONED' in f:
+ result.append((desc, 'postponed', assignee))
+ break
+ else:
+ result.append((desc, 'todo', assignee))
+ break
else:
- result.append((desc, 'todo'))
+ result.append((desc, 'todo', 'nobody'))
return result
'''Collect blueprint work items from a moin wiki.'''
for url in urls:
- for (d, s) in get_moin_workitems(url):
- add_work_item(db, url, d, s, 'nobody')
+ for (d, s, a) in get_moin_workitems(url):
+ add_work_item(db, url, d, s, a)
#
# main