Exemplo n.º 1
0
def updatePttList(ptt, timevalue, bd):
    result = None
    try:
        vals = (ptt, timevalue)
        pttObj = tables.PttList(*vals)
        dbutil.dbUpdate(conn, pttObj.sql_update_last(), pttObj.param_dict())
    except Exception as e:
        print 'updatePttList error ' + e.message
        conn.rollback()
    finally:
        vals = None
        pttObj = None
        conn.commit()
Exemplo n.º 2
0
def updatePttList(ptt, last_date, bd):

    timeVal = util.date2Str(last_date, rawFmt) if bd else last_date
    try:
        vals = (ptt, timeVal)
        pttObj = tables.PttList(*vals)
        dbutil.dbUpdate(conn, pttObj.sql_update_last(), pttObj.param_dict())
    except Exception as e:
        print 'updatePttList error ' + e.message
        conn.rollback()
    finally:
        vals = None
        pttObj = None
        conn.commit()
Exemplo n.º 3
0
def updateDevice(tag_id, timevalue, bd):
    result = None
    try:
        dev = (tag_id, timevalue)
        deviceObj = tables.Device(*dev)
        dbutil.dbUpdate(conn, deviceObj.sql_update_last(),
                        deviceObj.param_dict())
    except Exception as e:
        print 'updateDevice error ' + e.message
        conn.rollback()
    finally:
        dev = None
        deviceObj = None
        conn.commit()
Exemplo n.º 4
0
def updateDevice(tag_id, last_date, bd):

    timeVal = util.date2Str(last_date, rawFmt) if bd else last_date

    try:
        dev = (tag_id, timeVal)
        deviceObj = tables.Device(*dev)
        dbutil.dbUpdate(conn, deviceObj.sql_update_last(),
                        deviceObj.param_dict())

    except Exception as e:
        print 'updateDevice error ' + e.message
        conn.rollback()
    finally:
        dev = None
        deviceObj = None
        conn.commit()