]> piware.de Git - bin.git/blobdiff - workitems.py
workitems: make postpone an alias for postponed
[bin.git] / workitems.py
index 6dc4d6b58e4da51f2276dc973e3698863f091ec0..d5621062e2a58e07da80ac6575bf17b9cfcaeeaf 100755 (executable)
@@ -91,15 +91,17 @@ def get_blueprint_workitems(blueprint_url):
     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:
@@ -115,12 +117,17 @@ def get_blueprint_workitems(blueprint_url):
             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):