From 6f4e533becb95f6016b3e3eb7f230da7ff427904 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Wed, 24 Jun 2020 11:14:18 +0200 Subject: [PATCH] change list sessions stop signal to upcoming new-sm git master. This will break the program for now if you don't compiled nsm from source! --- engine/nsmservercontrol.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/engine/nsmservercontrol.py b/engine/nsmservercontrol.py index 84a7953..b008ebb 100644 --- a/engine/nsmservercontrol.py +++ b/engine/nsmservercontrol.py @@ -649,12 +649,16 @@ class NsmServerControl(object): self._queue.append(msg) continue #This is what we want: - elif msg.oscpath == "/reply" and msg.params[0] == "/nsm/server/list": - #/reply ['/nsm/server/list', 'test3'] - self.internalState["sessions"].add(msg.params[1]) - logger.info(f"Received session name: {msg.params[1]}") - elif msg.params[0] == 0 and msg.params[1] == "Done.": - break + elif msg.oscpath == "/reply" and msg.params[0] == "/nsm/server/list": + #/reply ['/nsm/server/list', 'test3'] for a real session or + #/reply ['/nsm/server/list', ''] as "list ended" marker + if msg.params[1]: + self.internalState["sessions"].add(msg.params[1]) + logger.info(f"Received session name: {msg.params[1]}") + else: #empty string + break + #elif msg.params[0] == 0 and msg.params[1] == "Done.": # legacy nsmd sent the wrong message. Fixed in new-session-manager june 2020 + # break else: logger.warning(f"Expected project but got path {msg.oscpath} with {msg.params}. Adding to queue for later.") self._queue.append(msg)