Mercurial > getan
changeset 61:4b58763e75c1
Show project name before time entries
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 19 May 2011 13:04:21 +0200 |
parents | 9df5d62e6f7e |
children | 2b600cccf95e |
files | contrib/zeiterfassung |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/zeiterfassung Tue May 03 14:43:58 2011 +0200 +++ b/contrib/zeiterfassung Thu May 19 13:04:21 2011 +0200 @@ -224,9 +224,10 @@ else: cur.execute(ENTRIES_YEAR, {'project_id': project_id, 'year':proj_year}) total_proj = 0 - while True: - row = cur.fetchone() - if not row: break + row = cur.fetchone() + if row or empty_proj: + print "# project: %s (%s)" % (project, proj_desc) + while row: d = date(*map(int, row[0].split('-'))) t = max(60, row[1]) c = row[2] @@ -245,9 +246,9 @@ user, workpackage, c) + row = cur.fetchone() total += total_proj if empty_proj or total_proj > 0: - print "# project: %s (%s)" % (project, proj_desc) print "# total: %sh\n\n" % human_time(total_proj) print "# total all projects: %sh\n\n" % human_time(total) finally: