Exemplo n.º 1
0
def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        pass
    except Exception,ex:
        raise ex
Exemplo n.º 2
0
def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        pass
    except Exception, ex:
        raise ex
Exemplo n.º 3
0
def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        return cursor
    except:
        conn.close()
        cursor = conn.cursor()
        cld(cursor, sql, conn)
    return cursor
Exemplo n.º 4
0
def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        return cursor
    except:
        conn.close()
        cursor=conn.cursor()
        cld(cursor, sql, conn)
    return cursor
Exemplo n.º 5
0
from traceback import print_exc

def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        pass
    except Exception,ex:
        raise ex
    except:
        print_exc()
        print "try again"
        conn._rollback()
        conn.close()
        cursor=conn.cursor()
        cld(cursor, sql, conn)
    return cursor

def parseAOpLogData(device, conn, cursor, lines):
    print "user or op lines count:", len(lines)
    c=0;
    ec=0;
    try:
        user=False
        for line in lines:
            try:
                if line:
                    user=lineToUser(cursor,device,line)
                    c=c+1
            except Exception,e:
                ec=ec+1
Exemplo n.º 6
0

def commitLog(conn, cursor, sql):
    try:
        cld(cursor, sql, conn)
    except IntegrityError:
        pass
    except Exception, ex:
        raise ex
    except:
        print_exc()
        print 'try again'
        conn._rollback()
        conn.close()
        cursor = conn.cursor()
        cld(cursor, sql, conn)

    return cursor


def parseAOpLogData(device, conn, cursor, lines):
    print 'user or op lines count:', len(lines)
    c = 0
    ec = 0
    try:
        user = False
        for line in lines:
            try:
                if line:
                    user = lineToUser(cursor, device, line)
                    c = c + 1