def initializeReload(self): # Dispatcher should only be created once. if self.dispatcher is None: #create dispatcher: self.dispatcher = Dispatcher(self) #else reload it else: self.dispatcher.reload()
def initializeReload(self): # Addons should only be created once if self.addons is None: self.addons = _ADDONS() else: self.addons.clear() # Dispatcher should only be created once. if self.dispatcher is None: #create dispatcher: self.dispatcher = Dispatcher(self) #else reload it else: self.dispatcher.reload()
def run(): """ Bootstraps the application. """ dispatcher = Dispatcher() input_file_path = sys.argv[1] if len(sys.argv) > 1 else None if input_file_path: try: with open(input_file_path, "r") as f: for cmd in f: response = dispatcher.dispatch(cmd) except FileNotFoundError: logger.error("No such file: {}".format(input_file_path)) else: cmd = None while True: cmd = input() if cmd: if cmd == 'exit': break else: response = dispatcher.dispatch(cmd)
def setUp(self): self.dispatcher = Dispatcher()