From 01399d4be6f3dacb7c0bed2b84edbbc63331b83e Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 18 Jan 2019 17:59:45 +0100 Subject: config templates are now actually used --- asciifarm/client/commandhandler.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'asciifarm/client/commandhandler.py') diff --git a/asciifarm/client/commandhandler.py b/asciifarm/client/commandhandler.py index db9f625..ca72b68 100644 --- a/asciifarm/client/commandhandler.py +++ b/asciifarm/client/commandhandler.py @@ -51,17 +51,16 @@ class CommandHandler: } def execute(self, action): - try: - if isinstance(action[0], str): - command = action[0] - if command in self.commands: - self.commands[command](*action[1:]) - else: - raise InvalidCommandException("Invalid command '{}'".format(command)) + if action is None: + return + if isinstance(action[0], str): + command = action[0] + if command in self.commands: + self.commands[command](*action[1:]) else: - raise Exception("Command should be a string") - except Exception as e: - self.log(e) + raise InvalidCommandException("Invalid command '{}'".format(command)) + else: + raise Exception("Command should be a string") # Commands -- cgit