setup_py3.py 556 B

12345678910111213141516171819202122232425
  1. import subprocess
  2. import setup_util
  3. from os.path import expanduser
  4. python = expanduser('~/FrameworkBenchmarks/installs/py3/bin/python3')
  5. cwd = expanduser('~/FrameworkBenchmarks/tornado')
  6. proc = None
  7. def start(args):
  8. global proc
  9. setup_util.replace_text(
  10. cwd + "/server.py", "localhost", args.database_host)
  11. proc = subprocess.Popen(
  12. python + " server.py --port=8080 --logging=error",
  13. shell=True, cwd=cwd)
  14. return 0
  15. def stop():
  16. global proc
  17. if proc:
  18. proc.terminate()
  19. proc = None
  20. return 0