From: martin@piware.de <> Date: Tue, 24 Nov 2009 16:34:35 +0000 (+0100) Subject: workitems: add by-assignee report to HTML output X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=c1b4847821323a45810815f9e1ac9a556ac42408;p=bin.git workitems: add by-assignee report to HTML output --- diff --git a/workitems.py b/workitems.py index db89f51..7b22e60 100755 --- a/workitems.py +++ b/workitems.py @@ -308,6 +308,30 @@ def blueprint_completion(db): return data +def assignee_completion(db): + '''Determine current by-assignee completion. + + Return assignee -> [todo, done, postponed] mapping. + ''' + data = {} + + # last date + cur = db.cursor() + cur.execute('SELECT max(date) FROM work_items') + (last_date,) = cur.fetchone() + + index = 0 + for s in valid_states: + cur = db.cursor() + cur.execute('SELECT assignee, count(workitem) FROM work_items ' + 'WHERE date=? and status=? GROUP BY assignee', + (last_date, s)) + for (a, num) in cur: + data.setdefault(a, [0, 0, 0])[index] = num + index += 1 + + return data + def text(db): '''Print work item completion as text.''' @@ -406,6 +430,27 @@ def html(db): print '' + print ''' +
Assignee | todo/postponed/done | Completion |
---|---|---|
%s | %i/%i/%i | %i%% |