#904 closed task (fixed)
add a python 2.4 version
Reported by: | sakkew | Owned by: | Sam Bloomquist |
---|---|---|---|
Priority: | normal | Component: | ScrumBurndownPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description (last modified by )
When running python burndown_job.py D:\trac\proj
I get :
Traceback (most recent call last): File "burndown_job.py", line 81, in ? main() File "burndown_job.py", line 28, in main env = open_environment(env_path) File "C:\Python24\Lib\site-packages\trac\env.py", line 436, in open_environmen t raise TracError, 'The Trac Environment needs to be upgraded. Run ' \ trac.core.TracError: The Trac Environment needs to be upgraded. Run trac-admin D :\trac\proj\ upgrade"
When I do python trac-admin d:\trac\proj upgrade
I get:
Command failed: table burndown already exists
Attachments (1)
Change History (6)
comment:1 Changed 18 years ago by
Description: | modified (diff) |
---|
comment:2 follow-up: 5 Changed 18 years ago by
Owner: | changed from Sam Bloomquist to dq@… |
---|
I'm new at python and my only goal was to get this running for me.
Anyway, I look into the problem and it seems that execute doesn't accept more than 1 parameter. I'm not sure why the author decided to introduce extra parcing for the table name. The following works just the same.
cursor.execute('SELECT * FROM burndown LIMIT 1')
Anyway, I preferred to disturn the code as little as possible and let the author choose his own solution. Here's the diff for my change. Also attached to this ticket is a egg file for python 2.4 that I use.
Index: burndown/burndown.py =================================================================== --- burndown/burndown.py (revision 1603) +++ burndown/burndown.py (working copy) @@ -40,7 +40,7 @@ # See if the burndown table exists, if not, return True because we need to upgrade the database cursor = db.cursor() try: - cursor.execute('SELECT * FROM %s LIMIT 1', 'burndown') + cursor.execute('SELECT * FROM %s LIMIT 1' % 'burndown') except: needsUpgrade = True
Changed 18 years ago by
Attachment: | TracBurndown-01.03.10-py2.4.egg added |
---|
Egg file with applied patch for python 2.4
comment:3 Changed 18 years ago by
Owner: | changed from dq@… to Sam Bloomquist |
---|
To the author:
Cool plugin... It you have questions, please drop me a mail.
comment:4 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 Changed 18 years ago by
Replying to dq@ubit.com:
Anyway, I look into the problem and it seems that execute doesn't accept more than 1 parameter. I'm not sure why the author decided to introduce extra parcing for the table name.
I'm not sure why I did that either - probably because I fell victim to the old cut'n'paste from another example.
I was not aware that Python 2.4 doesn't accept 2 parameters for the execute method because I'm really not much more than a hack at Python - have only learned enough to get what I need done. Java and C++ pay my bills, and Ruby has edged out Python for my non-work programming.
Thanks for the fix.
Fixing formatting.