def handle_reload(self, cmd, args, context): """!reload\nReload the list of commands.""" essentialSubscribers = _subscribers[0:2] #_send_all_msgs and Commands.handle_incoming for _ in range(len(_subscribers)): _subscribers.pop(0) for x in essentialSubscribers: _subscribers.append(x) self.init_commands() load_plugins() load_routes()
def main(): if not os.path.exists("data/"): os.mkdir("data/") Globals.settings = get_settings() Globals.commands = Commands() Globals.commands.init_commands() load_plugins() load_protocols() load_routes() try: signal.signal(signal.SIGQUIT, sigquit) signal.signal(signal.SIGHUP, sighup) except AttributeError: #windows compatability pass reactor.run() if Globals.restart: sys.argv[0] = os.path.abspath(sys.argv[0]) os.execv("/usr/bin/env", ["env", "python"] + sys.argv)