コード例 #1
0
def UpdateStatus(game_id,status):
    LogEvent("Update status of game to " + status)
    db_path = os.path.join(os.path.abspath(""),"Gamez.db")
    game_name = ""
    system = ""
    sql = "select game_name,system from requested_games where ID='" + game_id + "'"
    connection = sqlite3.connect(db_path)
    cursor = connection.cursor()
    cursor.execute(sql)
    result = cursor.fetchall()
    tables = list()
    for record in result:
        game_name = str(record[0])
        system = str(record[1])
    cursor.close()    
    sql = "update requested_games set status='" + status + "' where game_name = '" + game_name.replace("'","''") + "' and system = '" + system + "'"
    connection = sqlite3.connect(db_path)
    cursor = connection.cursor()
    cursor.execute(sql)
    connection.commit()
    cursor.close()
    message = "Gamez Notification: " + system + " Game: " + game_name + " has been " + status
    appPath = os.path.abspath("")
    Notifications.HandleNotifications(status,message,appPath)
    return