Browse Source

Testing setup.py, found issues with start and stop, and fixed.

Mark Kolich 11 years ago
parent
commit
41426182da
1 changed files with 7 additions and 5 deletions
  1. 7 5
      curacao/setup.py

+ 7 - 5
curacao/setup.py

@@ -1,26 +1,24 @@
 
 import subprocess
 import sys
-import time
 import os
 
 def start(args, logfile, errfile):
   if os.name == 'nt':
     subprocess.check_call('"..\\sbt\\sbt.bat" ";start;shell"', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
   else:
-    subprocess.check_call('"../sbt/sbt ";start;shell"', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+    subprocess.check_call('../sbt/sbt ";start;shell"', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
     
-  time.sleep(5)
   return 0
 
 def stop(logfile, errfile):
   if os.name == 'nt':
-    subprocess.check_call("wmic process where \"CommandLine LIKE '%curacao-benchmark%'\" call terminate", stderr=errfile, stdout=logfile)
+    subprocess.check_call("wmic process where \"CommandLine LIKE '%sbt-launch%'\" call terminate", stderr=errfile, stdout=logfile)
   else:
     p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
     out, err = p.communicate()
     for line in out.splitlines():
-      if 'curacao-benchmark' in line:
+      if 'sbt-launch' in line:
         try:
           pid = int(line.split(None, 2)[1])
           os.kill(pid, 15)
@@ -28,3 +26,7 @@ def stop(logfile, errfile):
           pass
   
   return 0
+
+##start([], open('log.out','a'), open('error.out','a'))
+##stop(open('log.out','a'), open('error.out','a'))
+