# HG changeset patch # User Björn Ricks # Date 1305803061 -7200 # Node ID 4b58763e75c19e81774353d3b81507cd39df4d25 # Parent 9df5d62e6f7e7de68eb6369570970e179cee1e2c Show project name before time entries diff -r 9df5d62e6f7e -r 4b58763e75c1 contrib/zeiterfassung --- 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: