comparison contrib/zeiterfassung @ 58:9826dcbf119f

rename total variable to total_proj because it refects to total time in a project
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 03 May 2011 14:31:11 +0200
parents 2f9093b41c5b
children 58bfac26a9ff
comparison
equal deleted inserted replaced
57:2f9093b41c5b 58:9826dcbf119f
217 cur.execute(WEEK_ENTRIES, {'project_id': project_id, 'week': week, 'year' : proj_year}) 217 cur.execute(WEEK_ENTRIES, {'project_id': project_id, 'week': week, 'year' : proj_year})
218 elif not year: 218 elif not year:
219 cur.execute(ENTRIES, {'project_id': project_id}) 219 cur.execute(ENTRIES, {'project_id': project_id})
220 else: 220 else:
221 cur.execute(ENTRIES_YEAR, {'project_id': project_id, 'year':proj_year}) 221 cur.execute(ENTRIES_YEAR, {'project_id': project_id, 'year':proj_year})
222 total = 0 222 total_proj = 0
223 while True: 223 while True:
224 row = cur.fetchone() 224 row = cur.fetchone()
225 if not row: break 225 if not row: break
226 d = date(*map(int, row[0].split('-'))) 226 d = date(*map(int, row[0].split('-')))
227 t = max(60, row[1]) 227 t = max(60, row[1])
228 c = row[2] 228 c = row[2]
229 total += t 229 total_proj += t
230 workpackage = "----" 230 workpackage = "----"
231 if c: 231 if c:
232 m = WORKPACKAGE.match(c) 232 m = WORKPACKAGE.match(c)
233 if m: 233 if m:
234 workpackage = m.group(1) 234 workpackage = m.group(1)
239 human_time(t), 239 human_time(t),
240 TYPE_OF_ENTRY, 240 TYPE_OF_ENTRY,
241 user, 241 user,
242 workpackage, 242 workpackage,
243 c) 243 c)
244 print "# total: %sh\n\n" % human_time(total) 244 print "# total: %sh\n\n" % human_time(total_proj)
245 finally: 245 finally:
246 tolerantClose(cur) 246 tolerantClose(cur)
247 tolerantClose(con) 247 tolerantClose(con)
248 248
249 except TermError, e: 249 except TermError, e:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)