Changeset 4736
- Timestamp:
- 11/04/08 14:32:49 (2 months ago)
- Files:
-
- scrumburndownplugin/build.bat (deleted)
- scrumburndownplugin/burndown/burndown.py (modified) (10 diffs)
- scrumburndownplugin/burndown/htdocs/images/trac-scrum-burndown-plugin-logo.png (added)
- scrumburndownplugin/burndown/templates/burndown.cs (modified) (2 diffs)
- scrumburndownplugin/burndown/templates/burndown.html (added)
- scrumburndownplugin/delete_svn.bat (deleted)
- scrumburndownplugin/deploy.bat (deleted)
- scrumburndownplugin/ext (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT/selenium-server-coreless.jar (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT/selenium-server.jar (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT/selenium-server-sources.jar (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT/selenium-server-tests.jar (added)
- scrumburndownplugin/ext/selenium-server-1.0-SNAPSHOT/selenium-server-test-sources.jar (added)
- scrumburndownplugin/README.txt (added)
- scrumburndownplugin/setup.py (modified) (2 diffs)
- scrumburndownplugin/test (added)
- scrumburndownplugin/test/nosetests (added)
- scrumburndownplugin/test/nosetests/testBurndown.py (added)
- scrumburndownplugin/test/nosetests/testEnvironmentSetup.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
scrumburndownplugin/burndown/burndown.py
r2215 r4736 1 1 # Burndown plugin 2 2 # Copyright (C) 2006 Sam Bloomquist <spooninator@hotmail.com> 3 # Copyright (C) 2006-2008 Daan van Etten <daan@stuq.nl> 3 4 # All rights reserved. 4 # vi: et ts=4 sw=4 5 5 6 # This software may at some point consist of voluntary contributions made by 6 7 # many individuals. For the exact contribution history, see the revision … … 8 9 # 9 10 # Author: Sam Bloomquist <spooninator@hotmail.com> 11 # Author: Daan van Etten <daan@stuq.nl> 10 12 11 13 import time 12 14 import datetime 13 15 import sys 16 17 from trac import __version__ as tracversion 18 tracversion=tracversion[:4] 14 19 15 20 from trac.core import * … … 17 22 from trac.env import IEnvironmentSetupParticipant 18 23 from trac.perm import IPermissionRequestor 19 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet 24 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet, add_script 20 25 from trac.web.main import IRequestHandler 21 26 from trac.util import escape, Markup, format_date … … 63 68 except: 64 69 needsCreate = True 65 70 71 db.commit(); 72 66 73 if needsCreate: 67 74 print >> sys.stderr, 'Attempting to create the burndown table' … … 140 147 def get_navigation_items(self, req): 141 148 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() 143 153 144 154 #--------------------------------------------------------------------------- … … 178 188 selected_component = req.args.get('selected_component', 'All Components') 179 189 180 # expose display data to the clearsilvertemplates190 # expose display data to the templates 181 191 req.hdf['milestones'] = milestones 182 192 req.hdf['components'] = components … … 185 195 req.hdf['draw_graph'] = False 186 196 req.hdf['start'] = False 187 197 self.log.debug(req.hdf['draw_graph']) 188 198 if req.perm.has_permission("BURNDOWN_ADMIN"): 189 199 req.hdf['start'] = True # show the start and complete milestone buttons to admins 190 200 201 req.hdf['burndown_data'] = [] 202 191 203 if req.args.has_key('start'): 192 204 self.start_milestone(db, selected_milestone) 193 205 else: 194 206 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) tuples196 207 # this will be a list of (id, hours_remaining) tuples 208 197 209 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 199 227 200 228 def get_burndown_data(self, db, selected_milestone, components, selected_component): … … 250 278 def get_templates_dirs(self): 251 279 """ 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. 254 281 """ 255 282 from pkg_resources import resource_filename … … 289 316 needs_update = False 290 317 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') 292 319 needs_update = True 293 320 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') 295 322 296 323 # get arrays of the various components and milestones in the trac environment … … 308 335 " LEFT OUTER JOIN ticket_custom ts ON (t.id = ts.ticket AND ts.name = 'totalhours') "\ 309 336 "WHERE t.component = '%s' AND t.milestone = '%s'"\ 310 " AND status IN ('new', 'assigned', 'reopened' ) "337 " AND status IN ('new', 'assigned', 'reopened', 'accepted') " 311 338 cursor.execute(sqlSelect % (comp[0], mile[0])) 312 339 scrumburndownplugin/burndown/templates/burndown.cs
r2199 r4736 3 3 4 4 <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/> 7 10 8 11 <form action="<?cs var:burndown.href ?>" method="get"> … … 60 63 <?cs /if ?> 61 64 65 </div> 62 66 <?cs include "footer.cs" ?> scrumburndownplugin/setup.py
r2199 r4736 1 from setuptools import setup 1 from setuptools import setup, find_packages 2 2 3 3 PACKAGE = 'TracBurndown' 4 VERSION = ' 01.08.10' # the last two decimals are meant to signify the Trac version4 VERSION = '1.9' 5 5 6 6 setup(name=PACKAGE, … … 9 9 url='http://www.trac-hacks.org/wiki/ScrumBurndownPlugin', 10 10 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/*']}, 13 13 entry_points={'trac.plugins': '%s = burndown' % PACKAGE}, 14 tests_require=['nose'], 15 test_suite = 'nose.collector' 14 16 )
