From: martin@piware.de <> Date: Wed, 5 Aug 2009 11:41:39 +0000 (+0100) Subject: workitems: add initial HTML report X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=c990185ecf4cf0c7f782fdbba7740cb47cf67d0c;p=bin.git workitems: add initial HTML report --- diff --git a/workitems.py b/workitems.py index b2295a2..6dc4d6b 100755 --- a/workitems.py +++ b/workitems.py @@ -5,7 +5,7 @@ import sqlite3 as dbapi2 blueprints_base_url = 'https://blueprints.launchpad.net' -valid_states = set(['todo', 'done', 'postponed']) +valid_states = ['todo', 'done', 'postponed'] def get_db(dbpath): '''Open/initialize database. @@ -48,6 +48,8 @@ def parse_argv(): help='Print work item summary in text format', dest='text') optparser.add_option('-c', '--csv', action='store_true', default=False, help='Print work item summary in CSV format', dest='csv') + optparser.add_option('-H', '--html', action='store_true', default=False, + help='Generate work item HTML report', dest='html') optparser.add_option('--from', metavar='YYYY-MM-DD', help='Generate CSV data from this day on', dest='from_date') optparser.add_option('--to', metavar='YYYY-MM-DD', @@ -57,7 +59,7 @@ def parse_argv(): if not opts.database: optparser.error('No database given') - if not opts.dump and not opts.text and not opts.csv: + if not opts.dump and not opts.text and not opts.csv and not opts.html: if not opts.release: optparser.error('No release given') if not opts.pattern: @@ -261,6 +263,54 @@ def csv(db, from_date, to_date): entry.get('postponed', 0)) d += datetime.timedelta(days=1) +def html(db): + '''Print work item status as HTML.''' + + print ''' +
+Blueprint | todo/postponed/done | Completion |
---|---|---|
%s | %i/%i/%i | %i%% |