31 # choose an arbitrary random port for runtime |
31 # choose an arbitrary random port for runtime |
32 self.runtime_port = int(random.random() * 1000) + 61131 |
32 self.runtime_port = int(random.random() * 1000) + 61131 |
33 self.local_runtime_log.write(_("Starting local runtime...\n")) |
33 self.local_runtime_log.write(_("Starting local runtime...\n")) |
34 # launch local runtime |
34 # launch local runtime |
35 self.local_runtime = ProcessLogger( |
35 self.local_runtime = ProcessLogger( |
36 self.local_runtime_log, |
36 self.local_runtime_log,[ |
37 ("\"%s\" \"%s\" -p %s -i "+LocalHost+" %s %s") % ( |
|
38 LocalRuntimeInterpreterPath, |
37 LocalRuntimeInterpreterPath, |
39 Bpath("Beremiz_service.py"), |
38 Bpath("Beremiz_service.py"), |
40 self.runtime_port, |
39 "-p", str(self.runtime_port), |
|
40 "-i", LocalHost, |
41 {False: "-x 0", True: "-x 1"}[self.use_gui], |
41 {False: "-x 0", True: "-x 1"}[self.use_gui], |
42 self.local_runtime_tmpdir), |
42 self.local_runtime_tmpdir], |
43 no_gui=False, |
43 no_gui=False, |
44 timeout=500, keyword=self.local_runtime_tmpdir, |
44 timeout=500, keyword=self.local_runtime_tmpdir, |
45 cwd=self.local_runtime_tmpdir) |
45 cwd=self.local_runtime_tmpdir) |
46 self.local_runtime.spin() |
46 self.local_runtime.spin() |
47 return self.runtime_port |
47 return self.runtime_port |