diff options
author | Markus Otto <otto@fs.tum.de> | 2015-08-14 19:01:05 +0200 |
---|---|---|
committer | Markus Otto <otto@fs.tum.de> | 2015-08-15 12:56:22 +0200 |
commit | 079c0cc1aa089c865768b232003570fa73fc52fa (patch) | |
tree | 682266b73e2544c6c8d1b3cde17ece5b636951c1 /voctocore/lib/controlserver.py | |
parent | 2aa635013174a8c73839d52d678e503eabed2900 (diff) |
add protocol features and minor fixes
Diffstat (limited to 'voctocore/lib/controlserver.py')
-rw-r--r-- | voctocore/lib/controlserver.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/voctocore/lib/controlserver.py b/voctocore/lib/controlserver.py index c457fee..1a75a49 100644 --- a/voctocore/lib/controlserver.py +++ b/voctocore/lib/controlserver.py @@ -46,7 +46,7 @@ class ControlServer(TCPMultiConnection): # process the received line success, msg = self.processLine(conn, line) - # success = False -> error + # success = False -> error if success == False: # on error-responses the message is mandatory if msg is None: @@ -71,8 +71,9 @@ class ControlServer(TCPMultiConnection): def processLine(self, conn, line): # split line into command and optional args - command, argstring = (line+' ').split(' ', 1) - args = argstring.strip().split() + words = line.split() + command = words[0] + args = words[1:] # log function-call as parsed self.log.info("Read Function-Call from %s: %s( %s )", conn.getpeername(), command, args) @@ -90,7 +91,9 @@ class ControlServer(TCPMultiConnection): ret = f(*args) # signal method call to all other connected clients - self.signal(conn, command, args) + # only signal set_* commands + if command.split('_')[0] in ["set", "message"]: + self.signal(conn, command, args) # if it returned an iterable, probably (Success, Message), pass that on if hasattr(ret, '__iter__'): |