コード例 #1
0
ファイル: new_wxchat.py プロジェクト: Honlan/Listen
def upload_msg(uid, username, puid, chatroom, msg_type, content, url):
    (db, cursor) = connectdb()
    cursor.execute(
        "insert into message(uid, username, puid, chatroom, msg_type, content, url, timestamp) values(%s, %s, %s, %s, %s, %s, %s, %s)",
        [
            uid, username, puid, chatroom, msg_type, content, url,
            int(time.time())
        ])
    closedb(db, cursor)
コード例 #2
0
        current -= 3600 * 24 * 30

    if len(listings) > 0:
        app.logger.error(
            str(OpenID) + ' history_basic total records ' + str(total))
        cursor.execute("delete from listing where ListingId in %s",
                       [[x[0] for x in listings]])
        cursor.executemany(
            "insert into listing(ListingId, Title, Months, CurrentRate, Amount, OpenID) values(%s, %s, %s, %s, %s, %s)",
            listings)

    cursor.execute(
        "update task set status=%s, timestamp=%s where name=%s and OpenID=%s",
        ['finished', int(time.time()), 'bidBasicInfo', OpenID])
    closedb(db, cursor)

    app.logger.error(str(OpenID) + ' history_basic finish')
except Exception, e:
    app.logger.error(e)
else:
    Popen('python ' + FILE_PREFIX + 'history_detail.py ' + OpenID + ' ' +
          APPID + ' ' + AccessToken,
          shell=True)
    Popen('python ' + FILE_PREFIX + 'history_money.py ' + OpenID + ' ' +
          APPID + ' ' + AccessToken,
          shell=True)
    Popen('python ' + FILE_PREFIX + 'history_status.py ' + OpenID + ' ' +
          APPID + ' ' + AccessToken,
          shell=True)
    Popen('python ' + FILE_PREFIX + 'history_payback.py ' + OpenID + ' ' +