Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1d44af41 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

dev mode for grew.init

parent 0800fe64
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,12 @@ from grew import utils
''' Library tools '''
def init():
def init(dev=False):
"""
Initialize connection to GREW library
:return: True if anything went right
:return: the ouput of the subprocess.Popen command.
"""
return network.init()
return network.init(dev)
def grs(data):
"""Load a grs stored in a file
......
......@@ -25,13 +25,14 @@ def pid_exist(pid):
except:
return 0
def init():
def init(dev):
global port, remote_ip, caml_pid
grewpy = "grewpy_dev" if dev else "grewpy"
if not pid_exist(caml_pid):
python_pid = os.getpid()
while (port<8898):
caml = subprocess.Popen(
["grewpy", "--caller", str(python_pid), "--port", str(port)],
[grewpy, "--caller", str(python_pid), "--port", str(port)],
preexec_fn=preexec_function
)
caml_pid = caml.pid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment