found_workitems = False
result = []
for l in urllib.urlopen(blueprint_url):
+ end = False
if not found_workitems:
if work_items_re.search(l):
found_workitems = True
continue
- l = l.replace('<br />', '').replace('</div>', '').strip()
+ if '</p>' in l:
+ end = True
+ l = l.replace('<br />', '').replace('</div>', '').replace('</p>', '').strip()
- # ends with empty line
- if l.endswith('</p>') or not l:
+ if not l:
break
try:
state = 'done'
if state == 'inprogress':
state = 'todo'
+ if state == 'postpone':
+ state = 'postponed'
if state not in valid_states:
print >> sys.stderr, 'ERROR: invalid state "%s" for work item "%s"' % (
state, desc)
continue
result.append((desc, state))
+ if end:
+ break
+
return result
def get_moin_workitems(url):