diff --git a/PYROSW.py b/PYROSW.py index e67bf71..6f0b551 100755 --- a/PYROSW.py +++ b/PYROSW.py @@ -107,15 +107,32 @@ if DOCKER_OUT_CONTAINER: # cd docker/ os.chdir('docker') # docker-compose up -d - res = subprocess.run("docker exec -it pyros python3 pyros.py",stdout=subprocess.DEVNULL) + res = subprocess.run("docker exec -it pyros python3 pyros.py",shell=True,stdout=subprocess.DEVNULL) if res.returncode != 0: run('docker-compose up -d') sleep(5) PYROS_CMD = 'docker exec -it pyros ' + PYROS_CMD -# PYROS_CMD -print("\n Executing command :", PYROS_CMD, "\n") -res = run(PYROS_CMD) +if VENV: + does_venv_folder_exists = os.path.exists("./venv") + print(does_venv_folder_exists) + print(WITH_DOCKER_IS_SET) + if not does_venv_folder_exists and not WITH_DOCKER_IS_SET: + print("No virtual environment available.") + exit(0) + path_to_bin_folder = "" + print("\n Executing command in venv :", PYROS_CMD, "\n") + if os.name == "posix": + res = run(f"./venv/venv_py3_pyros/"+PYROS_CMD) + elif os.name == "nt": + res = run("./venv/venv_py3_pyros/Scripts/python.exe pyros.py "+ args) + else: + # java + pass +else: + # PYROS_CMD + print("\n Executing command :", PYROS_CMD, "\n") + res = run(PYROS_CMD) ''' #Print the stdout and stderr -- libgit2 0.21.2