Changeset 1667

Show
Ignore:
Timestamp:
12/11/06 11:24:33 (2 years ago)
Author:
bobbysmith007
Message:

TimingAndEstimationPlugin:

Incorporated changed from kkurzweil@lulu.com for postegresql compatibility.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • timingandestimationplugin/trunk/setup.py

    r1631 r1667  
    88      description='Plugin to make Trac support time estimation and tracking', 
    99      keywords='trac plugin estimation timetracking', 
    10       version='0.3.1', 
     10      version='0.3.2', 
    1111      url='', 
    1212      license='http://www.opensource.org/licenses/mit-license.php', 
     
    3838## rather than hours 
    3939 
     40## kkurzweil@lulu.com 
     41## helped postegresql db backend compatiblity 
    4042 
  • timingandestimationplugin/trunk/timingandestimationplugin/dbhelper.py

    r1626 r1667  
    1212        desc = cur.description 
    1313        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 \ 
     16with parameters:%s\nException:%s'%(sql, params, e)); 
     17        db.rollback(); 
     18    cur.close() 
     19    db.close() 
    1720    return (desc, data) 
    1821 
    19 def execute_non_query(con, sql, *params): 
     22def execute_non_query(db, sql, *params): 
    2023    """Executes the query on the given project""" 
    21     cur = con.cursor() 
     24    cur = db.cursor() 
    2225    try: 
    2326        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 \ 
     30with parameters:%s\nException:%s'%(sql, params, e)); 
     31        db.rollback(); 
     32         
     33    cur.close()  
     34    db.close() 
    2835 
    2936 
    3037def get_scalar(db, sql, col=0, *params): 
    3138    cur = db.cursor() 
     39    data = None; 
    3240    try: 
    3341        cur.execute(sql, params) 
     
    3947        mylog.error('There was a problem executing sql:%s \n \ 
    4048with parameters:%s\nException:%s'%(sql, params, e)); 
    41         cur.close(); 
    42         db.close(); 
     49        db.rollback() 
     50    cur.close(); 
     51    db.close(); 
    4352    if data: 
    4453        return data[col] 
     
    7079    try: 
    7180        cur.execute(sql) 
    72         db.commit(); 
    73         cur.close() 
    74         db.close() 
     81        db.commit() 
    7582    except Exception, e: 
    7683        has_table = False 
     84        db.rollback() 
    7785         
    78         cur.close() 
    79         db.close() 
     86    cur.close() 
     87    db.close() 
    8088    return has_table 
    8189 
  • timingandestimationplugin/trunk/timingandestimationplugin/ticket_daemon.py

    r1627 r1667  
    6565                change_time = ticket.time_created 
    6666                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)
    6868                 
    6969            newtotal = str(totalHours+hours) 
    7070 
    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)
    7272            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) )             
    7474 
    7575    def ticket_created(self, ticket):