diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-10 23:52:31 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-10 23:52:31 +0200 |
commit | 10058b623dee99ed54421ff204b51adcc9a379d0 (patch) | |
tree | ea58d8bfb7eb4e7f667e7c8a25ce0fc40e302537 /voctocore/lib/controlserver.py | |
parent | e2602d0aecefccd10fbe1a0cce13bb9f68e60830 (diff) |
implement side-by-side-equal composition
Diffstat (limited to 'voctocore/lib/controlserver.py')
-rw-r--r-- | voctocore/lib/controlserver.py | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/voctocore/lib/controlserver.py b/voctocore/lib/controlserver.py index e267ca7..2b96152 100644 --- a/voctocore/lib/controlserver.py +++ b/voctocore/lib/controlserver.py @@ -90,20 +90,15 @@ class ControlServer(): return False, 'unknown command %s' % command - try: - # fetch the function-pointer - f = getattr(self.commands, command) - - # call the function - ret = f(*args) - - # if it returned an iterable, probably (Success, Message), pass that on - if hasattr(ret, '__iter__'): - return ret - else: - # otherwise construct a tuple - return (ret, None) - - except Exception as e: - # In case of an Exception, return that - return False, str(e) + # fetch the function-pointer + f = getattr(self.commands, command) + + # call the function + ret = f(*args) + + # if it returned an iterable, probably (Success, Message), pass that on + if hasattr(ret, '__iter__'): + return ret + else: + # otherwise construct a tuple + return (ret, None) |