~mabac/launchpad-work-items-tracker/add-progress-bars-to-lane

« back to all changes in this revision

Viewing changes to report_tools.py

  • Committer: Mattias Backman
  • Date: 2011-10-31 16:09:56 UTC
  • mfrom: (303.2.2 count-blueprints)
  • Revision ID: mattias.backman@linaro.org-20111031160956-4p5mzb6rz1l792ps
List and count linked blueprints per high level status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
974
974
                       Meta.value == roadmap_id)
975
975
    return [meta.blueprint for meta in metas]
976
976
 
 
977
 
 
978
def card_blueprints_by_status(store, roadmap_id):
 
979
    blueprints = card_blueprints(store, roadmap_id)
 
980
    statuses = { 'Completed': ['Implemented'],
 
981
                 'Blocked': ['Needs Infrastructure', 'Blocked', 'Deferred'],
 
982
                 'In Progress': ['Deployment', 'Needs Code Review',
 
983
                                 'Beta Available', 'Good progress',
 
984
                                 'Slow progress', 'Started'],
 
985
                 'Planned': ['Unknown', 'Not started', 'Informational'] }
 
986
    bp_by_status = { 'Completed': [],
 
987
                 'Blocked': [],
 
988
                 'In Progress': [],
 
989
                 'Planned': [] }
 
990
    for bp in blueprints:
 
991
        for status in statuses.iterkeys():
 
992
            if bp.implementation in statuses[status]:
 
993
                bp_by_status[status].append(bp)
 
994
                break
 
995
    return bp_by_status
 
996
 
 
997
 
977
998
def subteams(store, team):
978
999
    result = store.execute('SELECT name from team_structure where team = ?', (unicode(team),))
979
1000
    return [i[0] for i in result]