@ -377,14 +377,19 @@ class NsmServerControl(object):
self.nsmOSCUrl=o.netloc.split(":")[0],o.port
else:
envResult=self._getNsmOSCUrlFromEnvironment()
print(2)
ifenvResult:
#In case there is no actual nsmd running but there still was a NSM_URL env var, e.g. over the network, use this.
#There is a corner case that the env is local but the user chose to ignore the GUI way (nsmd 1.6.0) to proivde us directly with a specific URL.
self.nsmOSCUrl=envResult
else:
#This is the default case. User just starts the GUI. The other modes are concious decisions to either start with URL as parameter or in an NSM environment.
#But now we need to test if the user accidentaly opened a second GUI, which would start a second server.
#We need to test if the user accidentaly opened a second GUI, which would start a second server.
self._setupAndTestForSingleInstance()#This might quit the whole program and we will never see the next line.
#TODO: there is a corner case: 1) manually start nsmd locally 2) start agordejo first time and connect to running nsmd 3) start 2nd agordejo and connect to the same server.
#it will not prevent it. But we need it because all other scenarios prevent agordejo multiple times for actual different servers, which is of course wanted.
#Better let something uncorrect slip than to prevent legit usecases!
#The important check here is to see if Agordejo, with internal nsmd, was started twice or not. Which works. That's all.
self.nsmOSCUrl=self._generateFreeNsmOSCUrl()
assertself.nsmOSCUrl
@ -422,7 +427,7 @@ class NsmServerControl(object):
self.singleInstanceActivateWindowHook=singleInstanceActivateWindowHook#added to self.processSingleInstance() to listen for a message from another wannabe-instance
self.singleInstanceActivateWindowHook=singleInstanceActivateWindowHook#added to self.listenToAnotherInstanceAttempt() to listen for a message from another wannabe-instance
self._receiverActive=True
logger.info("nsmservercontrol init is complete. Ready for event loop")
@ -430,22 +435,28 @@ class NsmServerControl(object):
#Internal Methods
def_setupAndTestForSingleInstance(self):
"""on program startup trigger this if there is already another instance of us running.