| 287 | | if is_weekly: |
|---|
| 288 | | today = datetime.date.today() |
|---|
| 289 | | today_year = today.strftime("%Y") |
|---|
| 290 | | today_week = today.strftime("%W") |
|---|
| 291 | | |
|---|
| 292 | | # make sure that there isn't already an entry for this week in the burndown table |
|---|
| 293 | | cursor.execute("SELECT id FROM burndown WHERE week = '%s' and year = '%s'" % (today_week, today_year)) |
|---|
| 294 | | else: |
|---|
| 295 | | today = format_date(int(time.time())) |
|---|
| 296 | | |
|---|
| 297 | | # make sure that there isn't already an entry for today in the burndown table |
|---|
| 298 | | cursor.execute("SELECT id FROM burndown WHERE date = '%s'" % today) |
|---|
| | 283 | today = format_date(int(time.time())) |
|---|
| | 284 | |
|---|
| | 285 | # make sure that there isn't already an entry for today in the burndown table |
|---|
| | 286 | cursor.execute("SELECT id FROM burndown WHERE date = '%s'" % today) |
|---|
| 339 | | if is_weekly: |
|---|
| 340 | | cursor.execute("UPDATE burndown SET hours_remaining = '%f' WHERE week = '%s' AND year = '%s' AND milestone_name = '%s'"\ |
|---|
| 341 | | "AND component_name = '%s'" % (hours, today_week, today_year, mile[0], comp[0])) |
|---|
| 342 | | else: |
|---|
| 343 | | cursor.execute("UPDATE burndown SET hours_remaining = '%f' WHERE date = '%s' AND milestone_name = '%s'"\ |
|---|
| 344 | | "AND component_name = '%s'" % (hours, today, mile[0], comp[0])) |
|---|
| | 327 | cursor.execute("UPDATE burndown SET hours_remaining = '%f' WHERE date = '%s' AND milestone_name = '%s'"\ |
|---|
| | 328 | "AND component_name = '%s'" % (hours, today, mile[0], comp[0])) |
|---|
| 346 | | if is_weekly: |
|---|
| 347 | | cursor.execute("INSERT INTO burndown(id,component_name, milestone_name, week, year, hours_remaining) "\ |
|---|
| 348 | | " VALUES(NULL,'%s','%s','%s','%s',%f)" % (comp[0], mile[0], today_week, today_year, hours)) |
|---|
| 349 | | else: |
|---|
| 350 | | cursor.execute("INSERT INTO burndown(id,component_name, milestone_name, date, hours_remaining) "\ |
|---|
| 351 | | " VALUES(NULL,'%s','%s','%s',%f)" % (comp[0], mile[0], today, hours)) |
|---|
| | 330 | cursor.execute("INSERT INTO burndown(id,component_name, milestone_name, date, hours_remaining) "\ |
|---|
| | 331 | " VALUES(NULL,'%s','%s','%s',%f)" % (comp[0], mile[0], today, hours)) |
|---|