Show
Ignore:
Timestamp:
11/04/08 14:32:49 (2 months ago)
Author:
daan
Message:

Release of version 1.9 of the Trac Scrum burndown plugin.
See http://stuq.nl/weblog/2008-11-04/scrum-burndown-plugin-19-released for more information.

The Scrum burndown plugin is currently compatible and tested with Trac 0.10.5, Trac 0.11.1, Python 2.4 and Python 2.5.

Issues fixed:
Fixed #3498 Incompatible with Genshi 0.5
Fixed #1743 No support for 0.11 version on trac
Fixed #2330 How to enable ScrumBurndownPlugin in 0.11b1
Fixed #1590 printing to stderr causes svn post-commit hook to crash
Fixed #1510 Porting to Trac 0.11 and Genshi templates
Fixed #2936 problem installing plugin
Fixed #1668 Environment Not Found
Fixed #1472 URL Not Found when click Burndown menu
Fixed #3017 Trac 0.11 - Burndown Chart does not show tickets with status 'accepted'

Files:

Legend:

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

    r2215 r4736  
    11# Burndown plugin 
    22# Copyright (C) 2006 Sam Bloomquist <spooninator@hotmail.com> 
     3# Copyright (C) 2006-2008 Daan van Etten <daan@stuq.nl> 
    34# All rights reserved. 
    4 # vi: et ts=4 sw=4 
     5 
    56# This software may at some point consist of voluntary contributions made by 
    67# many individuals. For the exact contribution history, see the revision 
     
    89# 
    910# Author: Sam Bloomquist <spooninator@hotmail.com> 
     11# Author: Daan van Etten <daan@stuq.nl> 
    1012 
    1113import time 
    1214import datetime 
    1315import sys 
     16 
     17from trac import __version__ as tracversion 
     18tracversion=tracversion[:4] 
    1419 
    1520from trac.core import * 
     
    1722from trac.env import IEnvironmentSetupParticipant 
    1823from trac.perm import IPermissionRequestor 
    19 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet 
     24from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet, add_script 
    2025from trac.web.main import IRequestHandler 
    2126from trac.util import escape, Markup, format_date 
     
    6368        except: 
    6469            needsCreate = True 
    65              
     70         
     71        db.commit(); 
     72         
    6673        if needsCreate: 
    6774            print >> sys.stderr, 'Attempting to create the burndown table' 
     
    140147    def get_navigation_items(self, req): 
    141148        if req.perm.has_permission("BURNDOWN_VIEW"): 
    142             yield 'mainnav', 'burndown', Markup('<a href="%s">Burndown</a>', self.env.href.burndown()) 
     149            if tracversion=="0.11": 
     150                yield 'mainnav', 'burndown', Markup('<a href="%s">Burndown</a>' % req.href.burndown()) 
     151            elif tracversion=="0.10": 
     152                yield 'mainnav', 'burndown', Markup('<a href="%s">Burndown</a>') % req.href.burndown() 
    143153 
    144154    #--------------------------------------------------------------------------- 
     
    178188        selected_component = req.args.get('selected_component', 'All Components') 
    179189         
    180         # expose display data to the clearsilver templates 
     190        # expose display data to the templates 
    181191        req.hdf['milestones'] = milestones 
    182192        req.hdf['components'] = components 
     
    185195        req.hdf['draw_graph'] = False 
    186196        req.hdf['start'] = False 
    187          
     197        self.log.debug(req.hdf['draw_graph']) 
    188198        if req.perm.has_permission("BURNDOWN_ADMIN"): 
    189199            req.hdf['start'] = True # show the start and complete milestone buttons to admins 
    190200         
     201        req.hdf['burndown_data'] = [] 
     202         
    191203        if req.args.has_key('start'): 
    192204            self.start_milestone(db, selected_milestone) 
    193205        else: 
    194206            req.hdf['draw_graph'] = True 
    195             req.hdf['burndown_data'] = self.get_burndown_data(db, selected_milestone, components, selected_component) # this will be a list of (id, hours_remaining) tuples 
    196          
     207            # this will be a list of (id, hours_remaining) tuples 
     208                 
    197209        add_stylesheet(req, 'hw/css/burndown.css') 
    198         return 'burndown.cs', None 
     210        add_script(req, 'hw/js/line.js') 
     211        add_script(req, 'hw/js/wz_jsgraphics.js') 
     212         
     213        if tracversion=="0.11": 
     214            data={'milestones': milestones, 
     215                  'components': components, 
     216                  'selected_milestone': selected_milestone, 
     217                  'selected_component': selected_component, 
     218                  'draw_graph': req.hdf['draw_graph'], 
     219                  'start': req.hdf['start'], 
     220                  'burndown_data': self.get_burndown_data(db, selected_milestone, components, selected_component) 
     221                  } 
     222            return 'burndown.html', data, None 
     223        elif tracversion=="0.10": 
     224            req.hdf['burndown_data'] = self.get_burndown_data(db, selected_milestone, components, selected_component) 
     225            return 'burndown.cs', None 
     226         
    199227         
    200228    def get_burndown_data(self, db, selected_milestone, components, selected_component): 
     
    250278    def get_templates_dirs(self): 
    251279        """ 
    252         Return the absolute path of the directory containing the provided 
    253         ClearSilver templates. 
     280        Return the absolute path of the directory containing the provided templates. 
    254281        """ 
    255282        from pkg_resources import resource_filename 
     
    289316        needs_update = False 
    290317        if row: 
    291             print >> sys.stderr, 'update_burndown_data has already been run - update needed' 
     318            self.log.debug('update_burndown_data has already been run - update needed') 
    292319            needs_update = True 
    293320        else: 
    294             print >> sys.stderr, 'first run of update_burndown_data - insert needed' 
     321            self.log.debug('first run of update_burndown_data - insert needed') 
    295322         
    296323        # get arrays of the various components and milestones in the trac environment 
     
    308335                                        "    LEFT OUTER JOIN ticket_custom ts ON (t.id = ts.ticket AND ts.name = 'totalhours') "\ 
    309336                                        "WHERE t.component = '%s' AND t.milestone = '%s'"\ 
    310                                         "    AND status IN ('new', 'assigned', 'reopened') " 
     337                                        "    AND status IN ('new', 'assigned', 'reopened', 'accepted') " 
    311338                    cursor.execute(sqlSelect % (comp[0], mile[0])) 
    312339                 
  • scrumburndownplugin/burndown/templates/burndown.cs

    r2199 r4736  
    33 
    44<div id="content" class="burndown"> 
    5  <h1>Burndown Chart</h1> 
    6 </div> 
     5<table cellpadding="0" cellspacing="0" border="0"> 
     6<tr><td><img src="<?cs var:chrome.href ?>/hw/images/trac-scrum-burndown-plugin-logo.png" /></td> 
     7<td><h1 style="left: 20px; position: relative;">Burndown Chart</h1></td> 
     8</tr></table> 
     9<br/> 
    710 
    811<form action="<?cs var:burndown.href ?>" method="get"> 
     
    6063<?cs /if ?> 
    6164 
     65</div> 
    6266<?cs include "footer.cs" ?> 
  • scrumburndownplugin/setup.py

    r2199 r4736  
    1 from setuptools import setup 
     1from setuptools import setup, find_packages 
    22 
    33PACKAGE = 'TracBurndown' 
    4 VERSION = '01.08.10' # the last two decimals are meant to signify the Trac version 
     4VERSION = '1.9' 
    55 
    66setup(name=PACKAGE, 
     
    99      url='http://www.trac-hacks.org/wiki/ScrumBurndownPlugin', 
    1010      version=VERSION, 
    11       packages=['burndown']
    12       package_data={'burndown' : ['htdocs/js/*.js', 'htdocs/css/*.css', 'htdocs/images/*.jpg' ,'templates/*.cs']}, 
     11      packages=find_packages(exclude=['ez_setup'])
     12      package_data={'burndown' : ['htdocs/js/*.js', 'htdocs/css/*.css', 'htdocs/images/*' ,'templates/*']}, 
    1313      entry_points={'trac.plugins': '%s = burndown' % PACKAGE}, 
     14      tests_require=['nose'], 
     15      test_suite = 'nose.collector' 
    1416)