def main(): """ 0: 判题请求 参数:提交id 是否重判 ps:192 0(solve_id为192的提交 非重判) 1:更新User信息 参数:用户id 2: Down题请求 参数:OJ缩写 Problem_id """ reload(sys) sys.setdefaultencoding('utf8') connect = Connect() thread() while True: message = connect.get_message() try: if message[0] == '0': new_judge = JudgeProducer(message[1:]) new_judge.start() elif message[0] == '1': u = Update(message[1]) u.start() elif message[0] == '2': pass else: raise IndexError except IndexError: logging.error("Error message!!! message: " + ' '.join(message)) else: connect.receive_message()
# coding=utf-8 __author__ = 'Code_Cola' from account import Update u = Update(1, 1) u.start()