Commit d79da86add2d532fa54aa03de39377d6a841a7bd

Authored by Quentin Durand
1 parent 89e50f10
Exists in dev

Fixing pyros.py for windows and updated celery to 3.1.25

install/REQUIREMENTS.txt
... ... @@ -3,7 +3,7 @@ amqplib==1.0.2
3 3 anyjson==0.3.3
4 4 billiard==3.3.0.23
5 5 requests==2.12.3
6   -celery==3.1.23
  6 +celery==3.1.25
7 7 DateTime==4.1.1
8 8 Django==1.10.2
9 9 django-admin-tools==0.7.2
... ...
install/REQUIREMENTS_WINDOWS.txt
... ... @@ -3,7 +3,7 @@ amqplib==1.0.2
3 3 anyjson==0.3.3
4 4 billiard==3.3.0.23
5 5 requests==2.12.3
6   -celery==3.1.23
  6 +celery==3.1.25
7 7 DateTime==4.1.1
8 8 Django==1.10.2
9 9 django-admin-tools==0.7.2
... ...
pyros.py
... ... @@ -526,7 +526,7 @@ class Pyros(AManager):
526 526 self.changeDirectory("simulators/config")
527 527 self.printColor(Colors.BOLD, "Existing simulations : ", eol='')
528 528 sys.stdout.flush()
529   - if (self.system == "Windows") : self.execProcessSilent("dir conf*.json")
  529 + if (self.system == "Windows") : self.execProcessSilent("dir /B conf*.json")
530 530 else: self.execProcessSilent("ls conf*.json")
531 531 self.changeDirectory("..")
532 532 conf = self.askQuestion("Which simulation do you want to use", default="conf.json")
... ... @@ -580,7 +580,7 @@ class Pyros(AManager):
580 580 self.changeDirectory("simulators/config")
581 581 self.printColor(Colors.BOLD, "Existing simulations : ", eol='')
582 582 sys.stdout.flush()
583   - if (self.system == "Windows") : self.execProcessSilent("dir conf*.json")
  583 + if (self.system == "Windows") : self.execProcessSilent("dir /B conf*.json")
584 584 else: self.execProcessSilent("ls conf*.json")
585 585 self.changeDirectory("..")
586 586 conf = self.askQuestion("Which simulation do you want to use", default="conf.json")
... ... @@ -600,11 +600,11 @@ class Pyros(AManager):
600 600 self.replacePatternInFile("SIMULATOR = True", "SIMULATOR = False", "pyros/settings.py")
601 601 if (self.system == "Windows"):
602 602 self.execProcessAsync("taskkill /f /im python.exe")
603   - self.execProcessAsync("rm -f testdb.sqlite3")
  603 + self.execProcessAsync("del /f testdb.sqlite3")
604 604 self.changeDirectory("..")
605 605 return 0
  606 + else: self.execProcessAsync("rm -f testdb.sqlite3")
606 607 self.execProcessAsync("fuser -k 8000/tcp")
607   - self.execProcessAsync("rm -f testdb.sqlite3")
608 608 self.execProcessAsync("ps aux | grep \" domeSimulator.py\" | awk '{ print $2 }' | xargs kill")
609 609 self.execProcessAsync("ps aux | grep \" userSimulator.py\" | awk '{ print $2 }' | xargs kill")
610 610 self.execProcessAsync("ps aux | grep \" alertSimulator.py\" | awk '{ print $2 }' | xargs kill")
... ... @@ -623,7 +623,10 @@ class Pyros(AManager):
623 623 if (conf == ""):
624 624 self.printColor(Colors.BOLD, "Existing simulations : ", eol='')
625 625 sys.stdout.flush()
626   - self.execProcessSilent("ls conf*.json")
  626 + if (self.system == "Windows"):
  627 + self.execProcessSilent("dir /B conf*.json")
  628 + else:
  629 + self.execProcessSilent("ls conf*.json")
627 630 conf = self.askQuestion("Which simulation do you want to use ?", default="conf.json")
628 631 if not os.path.isfile(conf):
629 632 self.printColor(Colors.FAIL, "The simulation file " + conf + " does not exist")
... ...