def commit(self):
    (cur, con) = mysql_connect()
    dnow = datetime.datetime.now()
    dend = (datetime.datetime.now() + datetime.timedelta(days=1))
    types = [sq.token, sq.path, sq.datetime, sq.int]
    cols = ['tokenid', 'path', 'time', 'fileid']
    values = [self.token, self.path, dnow, 32423423]
    types += [sq.str(100), sq.path, sq.int, sq.int]
    cols += ['name', 'realpath', 'userid', 'permissions']
    values += [self.name, self.realpath, self.userid, 0]
    types += [sq.datetime, sq.int, sq.int]
    cols += ['expiration', 'size', 'cur']
    values += [dend, self.size, self.cur]
    try:
        qstr = sql_insertinto('uploadtokens', cols, values, types)
    except SQLParamError:
        raise SQLParamError('upload token error; see error.log for details')
    print('QSTR', qstr)
    cur.execute(qstr)
    con.commit()
def commit(self):
    (cur, con) = mysql_connect()
    dnow = datetime.datetime.now()
    dend = (datetime.datetime.now() + datetime.timedelta(days=1))
    types = [sq.token, sq.path, sq.datetime, sq.int]
    cols = ['tokenid', 'path', 'time', 'fileid']
    values = [self.token, self.path, dnow, 32423423]
    types += [sq.str(100), sq.path, sq.int, sq.int]
    cols += ['name', 'realpath', 'userid', 'permissions']
    values += [self.name, self.realpath, self.userid, 0]
    types += [sq.datetime, sq.int, sq.int]
    cols += ['expiration', 'size', 'cur']
    values += [dend, self.size, self.cur]
    try:
        qstr = sql_insertinto('uploadtokens', cols, values, types)
    except SQLParamError:
        raise SQLParamError('upload token error; see error.log for details')
    print('QSTR', qstr)
    cur.execute(qstr)
    con.commit()