setup.py 569 B

1234567891011121314151617181920212223
  1. import subprocess
  2. import sys
  3. import setup_util
  4. def start(args):
  5. try:
  6. subprocess.check_call("lein deps", shell=True, cwd="http-kit/hello")
  7. # lein run -- --help for more options
  8. command = "lein run -- --db-host " + args.database_host
  9. subprocess.Popen(command, shell=True, cwd="http-kit/hello")
  10. return 0
  11. except subprocess.CalledProcessError:
  12. return 1
  13. def stop():
  14. try:
  15. # listen on 8080
  16. subprocess.check_call("lsof -t -sTCP:LISTEN -i:8080 | xargs kill", shell=True)
  17. return 0
  18. except subprocess.CalledProcessError:
  19. return 1