def story_dummies_for_orphans(items, no_parent): """ at the end append a story dummy for every rubbish at least to show identify false positives in the project """ dummies = { 'support': {'id': 'no_parent_support', 'subject': 'All support without a story'}, 'bug': { 'id': 'no_parent_bug', 'subject': 'All bugs without a story'}, 'task': { 'id': 'no_parent_task', 'subject': 'All tasks without a story'}, 'feature': {'id': 'no_parent_task', 'subject': 'All tasks without a story'} } for key, value in no_parent.iteritems(): if value: no_parent_item = { 'id': dummies[key]['id'], 'subject': dummies[key]['subject'], 'status': {'name': 'unknown'}, 'type': 'story', 'position': len(items['story']) + 1 } s = create_item(no_parent_item) items['story'].append(s) return items
print "» %.2f sec" % (time.time() - t1) for key, items in restructure.iteritems(): if key == "story": print "story » %.2f sec" % (time.time() - t1) for i, item in enumerate(items): success, details = get_issue_details(item['id']) details['type'] = 'story' details['position'] = i + 1 item.update(details) s = create_item(item) # s = Story(item) if updater and updater.has_key('story'): # update with data from last time this = updater['story'].get(s['id'], None) if this: s['position'] = this['position'] s['status'] = this['status'] s['sprint'] = this['sprint'] processed_items["story"].append(s) elif key == "support" or key == "task": print "task » %.2f sec" % (time.time() - t1)