Taska 21 Posted June 10, 2014 Share Posted June 10, 2014 #!/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
Tacos 205 Posted June 10, 2014 Share Posted June 10, 2014 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
Taska 21 Posted June 10, 2014 Author Share Posted June 10, 2014 Alright thanks Link to post Share on other sites
Shoxy 0 Posted June 14, 2014 Share Posted June 14, 2014 Mine is doing the same thing, how did you resolve yours? Link to post Share on other sites
Vinny 27 Posted June 14, 2014 Share Posted June 14, 2014 It's not "resolved". Sorry, but the trainer card thing is still broken. Can anyone confirm that? Let me change that title real quick. Link to post Share on other sites
Shoxy 0 Posted June 14, 2014 Share Posted June 14, 2014 Thanks for that, said it was resolved haha! Well i can confirm it from the amount of script that is showing and the lack of images, which goes for my sprite as well. Link to post Share on other sites
DashingStorm 3 Posted June 14, 2014 Share Posted June 14, 2014 Creating and updating TC's is broken until Ame mentions it's fixed. Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.