Changeset 1667
- Timestamp:
- 12/11/06 11:24:33 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
timingandestimationplugin/trunk/setup.py
r1631 r1667 8 8 description='Plugin to make Trac support time estimation and tracking', 9 9 keywords='trac plugin estimation timetracking', 10 version='0.3. 1',10 version='0.3.2', 11 11 url='', 12 12 license='http://www.opensource.org/licenses/mit-license.php', … … 38 38 ## rather than hours 39 39 40 ## kkurzweil@lulu.com 41 ## helped postegresql db backend compatiblity 40 42 timingandestimationplugin/trunk/timingandestimationplugin/dbhelper.py
r1626 r1667 12 12 desc = cur.description 13 13 db.commit(); 14 finally: 15 cur.close() 16 db.close() 14 except Exception, e: 15 mylog.error('There was a problem executing sql:%s \n \ 16 with parameters:%s\nException:%s'%(sql, params, e)); 17 db.rollback(); 18 cur.close() 19 db.close() 17 20 return (desc, data) 18 21 19 def execute_non_query( con, sql, *params):22 def execute_non_query(db, sql, *params): 20 23 """Executes the query on the given project""" 21 cur = con.cursor()24 cur = db.cursor() 22 25 try: 23 26 cur.execute(sql, params) 24 con.commit() 25 finally: 26 cur.close() 27 con.close() 27 db.commit() 28 except Exception, e: 29 mylog.error('There was a problem executing sql:%s \n \ 30 with parameters:%s\nException:%s'%(sql, params, e)); 31 db.rollback(); 32 33 cur.close() 34 db.close() 28 35 29 36 30 37 def get_scalar(db, sql, col=0, *params): 31 38 cur = db.cursor() 39 data = None; 32 40 try: 33 41 cur.execute(sql, params) … … 39 47 mylog.error('There was a problem executing sql:%s \n \ 40 48 with parameters:%s\nException:%s'%(sql, params, e)); 41 cur.close(); 42 db.close(); 49 db.rollback() 50 cur.close(); 51 db.close(); 43 52 if data: 44 53 return data[col] … … 70 79 try: 71 80 cur.execute(sql) 72 db.commit(); 73 cur.close() 74 db.close() 81 db.commit() 75 82 except Exception, e: 76 83 has_table = False 84 db.rollback() 77 85 78 cur.close()79 db.close()86 cur.close() 87 db.close() 80 88 return has_table 81 89 timingandestimationplugin/trunk/timingandestimationplugin/ticket_daemon.py
r1627 r1667 65 65 change_time = ticket.time_created 66 66 author = ticket.values["reporter"] 67 save_ticket_change( db, ticket_id, author, change_time, "hours", 0.0, hours)67 save_ticket_change( db, ticket_id, author, change_time, "hours", str(0.0), str(hours)) 68 68 69 69 newtotal = str(totalHours+hours) 70 70 71 save_ticket_change( db, ticket_id, author, change_time, "totalhours", str(totalHours), newtotal)71 save_ticket_change( db, ticket_id, author, change_time, "totalhours", str(totalHours), str(newtotal)) 72 72 save_custom_field_value( db, ticket_id, "hours", '0') 73 save_custom_field_value( db, ticket_id, "totalhours", newtotal)73 save_custom_field_value( db, ticket_id, "totalhours", str(newtotal) ) 74 74 75 75 def ticket_created(self, ticket):
