491 self.local_runtime_tmpdir = tempfile.mkdtemp() |
491 self.local_runtime_tmpdir = tempfile.mkdtemp() |
492 # choose an arbitrary random port for runtime |
492 # choose an arbitrary random port for runtime |
493 self.runtime_port = int(random.random() * 1000) + 61131 |
493 self.runtime_port = int(random.random() * 1000) + 61131 |
494 # launch local runtime |
494 # launch local runtime |
495 self.local_runtime = ProcessLogger(self.Log, |
495 self.local_runtime = ProcessLogger(self.Log, |
496 "\"%s\" \"%s\" -p %s -i localhost %s %s"%(sys.executable, |
496 "\"%s\" \"%s\" -p %s -i localhost %s %s"%( |
497 Bpath("Beremiz_service.py"), |
497 sys.executable, |
498 self.runtime_port, |
498 Bpath("Beremiz_service.py"), |
499 {False : "-x 0", True :"-x 1"}[taskbaricon], |
499 self.runtime_port, |
500 self.local_runtime_tmpdir), |
500 {False : "-x 0", True :"-x 1"}[taskbaricon], |
501 no_gui=False, |
501 self.local_runtime_tmpdir), |
502 timeout=500, keyword = "working") |
502 no_gui=False, |
|
503 timeout=500, keyword = "working", |
|
504 cwd = self.local_runtime_tmpdir) |
503 self.local_runtime.spin() |
505 self.local_runtime.spin() |
504 return self.runtime_port |
506 return self.runtime_port |
505 |
507 |
506 def KillLocalRuntime(self): |
508 def KillLocalRuntime(self): |
507 if self.local_runtime is not None: |
509 if self.local_runtime is not None: |