Show
Ignore:
Timestamp:
05/02/07 16:02:19 (2 years ago)
Author:
sambloomquist
Message:

ScrumBurndownPlugin:

removed the is_weekly stuff until I have more time to get it working correctly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • scrumburndownplugin/burndown/burndown.py

    r2200 r2215  
    277277    #------------------------------------------------------------------------ 
    278278    def update_burndown_data(self): 
    279         is_weekly = BoolOption('burndown', 'is_weekly', False, """Boolean for whether the unit of time for the burndown chart is a week or a day.""") 
    280          
    281         self.log.debug('burndown plugin - is_weekly: %b', is_weekly) 
    282          
    283279        db = self.env.get_db_cnx() 
    284280        cursor = db.cursor() 
    285281         
    286282        # today's date 
    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) 
    299287             
    300288        row = cursor.fetchone() 
     
    337325                     
    338326                    if needs_update: 
    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])) 
    345329                    else: 
    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)) 
    352332                                          
    353333        db.commit()