logger.info(f"[wait for answer]: Sending {path}: {arguments}")
logger.info("Got ping response")
self._setPause(True)
returnTrue
out_msg=_OutgoingMessage(path)
else:
forarginarguments:
logger.error(f"Waiting for ping, but got path: {msg.oscpath} with {msg.params}. Adding to queue for later. If the server got started anyway and is reacting to your commands, it is fine for now.")
out_msg.add_arg(arg)
self._queue.append(msg)
self._setPause(False)
ifnotrepeat:
self.sock.sendto(out_msg.build(),self.nsmOSCUrl)
def_waitForSessionRootBlocking(self):
#Wait for answer
"""Arrives after GUI Announce 'hi'
Thereisonlyonesessionroot"""
logger.info("Waiting for session root message in blocking mode")
logger.info(f"[wait from {path}] Received {answerPath}: {result}")
ready=True
elifmsg.oscpath==answerPath:
result=msg.params
logger.info(f"[wait from {path}] Received {answerPath}: {result}")
ready=True
ready=True
else:
else:
logger.error(f"Waiting for session root from nsmd, but got: {msg.oscpath} with {msg.params}. Adding to queue for later. If the server got started anyway and is reacting to your commands, it is fine for now.")
logger.warning(f"Waiting for {answerPath} from nsmd, but got: {msg.oscpath} with {msg.params}. Adding to queue for later.")
self._queue.append(msg)
self._queue.append(msg)
exceptBlockingIOError:#happens while no data is received. Has nothing to do with blocking or not.
exceptBlockingIOError:#happens while no data is received. Has nothing to do with blocking or not.
continue
continue
exceptsocket.timeout:
exceptsocket.timeout:
continue
continue
logger.info(f"Session root directory is {sessionRoot}")
raiseValueError("We were expecting a clean _queue with only 'hi' as leftover, but instead there were unhandled messages. see print above. Better abort than a wrong program state")
#all ok
returnpathlib.Path(resultArguments[0])
#General Commands
#General Commands
defsend(self,arg):
defsend(self,arg):
@ -599,6 +602,8 @@ class NsmServerControl(object):
self.sock.sendto(msg.build(),self.nsmOSCUrl)
self.sock.sendto(msg.build(),self.nsmOSCUrl)
defgui_announce(self):
defgui_announce(self):
"""This is just the announce without any answer. This is a last-resort method if another GUI