Jump to content

[Noted] Trainer Card Trouble


Taska

Recommended Posts

#!/usr/bin/env python import cgi import os import re import subprocess import sys import threading import Queue import MySQLdb ############################# [CONFIG] ############################### PATH = "/home/amethyst/public_html/tc/" ALPHA = "#DA0205" HOST = "http://pokemonreborn.com" THREADS = 10 DEBUG = False # Script shows more verbose output, but will break user-side functionality VISIBLE_BLANKS = 3 # Number of blank badge squares to display beyond the last badge. (without fight-up) ############################# [/CONFIG] ############################## JOIN = lambda x: os.path.join(PATH, x) BADGES = JOIN("badges.png") DB = MySQLdb.connect(user="amethyst_sprites", passwd="luna0-", host="localhost", db="amethyst_sprites").cursor(MySQLdb.cursors.DictCursor) DB.execute("SELECT * FROM 2leaders ORDER BY id ASC") RANKS = [leader["rank"] for leader in DB.fetchall()] Q = Queue.Queue() def debug(string=""): header(string) if DEBUG else header() def header(string=""): print "Content-type: text/html\n\n" + str(string) sys.exit() def run(command): call = subprocess.Popen(re.split(r"(? " % (HOST, res["id"])) # debug(err) except Exception as e: debug(str(res["id"]) + ": " + str(e.args) + " ... " + str(sys.exc_info()) + "
") def main(): form = cgi.FieldStorage() if "id" in form: try: id = int(form.getvalue("id")) except ValueError: header("Invalid trainer ID") DB.execute("SELECT * FROM members WHERE id=%s", (id,)) res = DB.fetchone() if not res: debug("Invalid member ID ... try %s/tc.py?id=1" % (HOST, HOST)) try: create(res) header(Q.get()) except Exception as e: debug(str(e.args)) else: output = "" DB.execute("SELECT * FROM members ORDER BY id ASC") threads = [threading.Thread(target=create, args=(member,)) for member in DB.fetchall()] for thread in threads: thread.start() while threading.activeCount() > THREADS: pass for thread in threads: thread.join() if not Q.empty(): output += Q.get() header(output) if __name__ == "__main__": main()

This is what happens when I try to update my trainer card..... any suggestions for me so I can get a trainer card?

Link to post
Share on other sites

You're gonna have to wait for your trainer card. It's been broken for quite a while. I'm sure Ame will let us know when it's fully functional.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...