def com_exec_background(method, current): to_e = getattr(current.commands, method) if required_set(variables): killme = threading.Event() pt = passthrough(qu, killme) p = threading.Thread(target=to_e, args=( variables, pt, )) p.daemon = True p.start() threads.append([current.__file__, p, pt]) return True else: return "required variables not set"
def com_exec_launch(method, current, debug=False): global qu to_e = getattr(current.commands, method) killme = threading.Event() pt = passthrough(qu, killme) if required_set(variables): qu.comrunning = True t = threading.Thread(target=to_e, args=( variables, pt, )) t.daemon = True t.start() threads.append([current.__file__, t, pt]) else: return "required variables not set"
def com_exec(method, current, debug=True): global qu to_e = getattr(current.commands, method) killme = threading.Event() pt = passthrough(qu, killme) if required_set(variables): #qu.comrunning = True if debug: #print variables['tripcode'][0] return to_e(variables, pt) else: try: return to_e(variables, pt) except: print "Exiting module..." return None else: return "required variables not set"