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 end or not l:
break
try: