From d79da86add2d532fa54aa03de39377d6a841a7bd Mon Sep 17 00:00:00 2001 From: Quentin Durand Date: Fri, 2 Feb 2018 15:47:44 +0100 Subject: [PATCH] Fixing pyros.py for windows and updated celery to 3.1.25 --- install/REQUIREMENTS.txt | 2 +- install/REQUIREMENTS_WINDOWS.txt | 2 +- pyros.py | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/install/REQUIREMENTS.txt b/install/REQUIREMENTS.txt index bc85033..ba156b0 100644 --- a/install/REQUIREMENTS.txt +++ b/install/REQUIREMENTS.txt @@ -3,7 +3,7 @@ amqplib==1.0.2 anyjson==0.3.3 billiard==3.3.0.23 requests==2.12.3 -celery==3.1.23 +celery==3.1.25 DateTime==4.1.1 Django==1.10.2 django-admin-tools==0.7.2 diff --git a/install/REQUIREMENTS_WINDOWS.txt b/install/REQUIREMENTS_WINDOWS.txt index ec8df1a..96f4ac8 100644 --- a/install/REQUIREMENTS_WINDOWS.txt +++ b/install/REQUIREMENTS_WINDOWS.txt @@ -3,7 +3,7 @@ amqplib==1.0.2 anyjson==0.3.3 billiard==3.3.0.23 requests==2.12.3 -celery==3.1.23 +celery==3.1.25 DateTime==4.1.1 Django==1.10.2 django-admin-tools==0.7.2 diff --git a/pyros.py b/pyros.py index cb5ab3b..63c3c1f 100644 --- a/pyros.py +++ b/pyros.py @@ -526,7 +526,7 @@ class Pyros(AManager): self.changeDirectory("simulators/config") self.printColor(Colors.BOLD, "Existing simulations : ", eol='') sys.stdout.flush() - if (self.system == "Windows") : self.execProcessSilent("dir conf*.json") + if (self.system == "Windows") : self.execProcessSilent("dir /B conf*.json") else: self.execProcessSilent("ls conf*.json") self.changeDirectory("..") conf = self.askQuestion("Which simulation do you want to use", default="conf.json") @@ -580,7 +580,7 @@ class Pyros(AManager): self.changeDirectory("simulators/config") self.printColor(Colors.BOLD, "Existing simulations : ", eol='') sys.stdout.flush() - if (self.system == "Windows") : self.execProcessSilent("dir conf*.json") + if (self.system == "Windows") : self.execProcessSilent("dir /B conf*.json") else: self.execProcessSilent("ls conf*.json") self.changeDirectory("..") conf = self.askQuestion("Which simulation do you want to use", default="conf.json") @@ -600,11 +600,11 @@ class Pyros(AManager): self.replacePatternInFile("SIMULATOR = True", "SIMULATOR = False", "pyros/settings.py") if (self.system == "Windows"): self.execProcessAsync("taskkill /f /im python.exe") - self.execProcessAsync("rm -f testdb.sqlite3") + self.execProcessAsync("del /f testdb.sqlite3") self.changeDirectory("..") return 0 + else: self.execProcessAsync("rm -f testdb.sqlite3") self.execProcessAsync("fuser -k 8000/tcp") - self.execProcessAsync("rm -f testdb.sqlite3") self.execProcessAsync("ps aux | grep \" domeSimulator.py\" | awk '{ print $2 }' | xargs kill") self.execProcessAsync("ps aux | grep \" userSimulator.py\" | awk '{ print $2 }' | xargs kill") self.execProcessAsync("ps aux | grep \" alertSimulator.py\" | awk '{ print $2 }' | xargs kill") @@ -623,7 +623,10 @@ class Pyros(AManager): if (conf == ""): self.printColor(Colors.BOLD, "Existing simulations : ", eol='') sys.stdout.flush() - self.execProcessSilent("ls conf*.json") + if (self.system == "Windows"): + self.execProcessSilent("dir /B conf*.json") + else: + self.execProcessSilent("ls conf*.json") conf = self.askQuestion("Which simulation do you want to use ?", default="conf.json") if not os.path.isfile(conf): self.printColor(Colors.FAIL, "The simulation file " + conf + " does not exist") -- libgit2 0.21.2