setup.py 619 B

12345678910111213141516171819202122
  1. import subprocess
  2. import sys
  3. import setup_util
  4. import os
  5. def start(args, logfile, errfile):
  6. if os.name != 'nt':
  7. return 1
  8. try:
  9. setup_util.replace_text("HttpListener/HttpListener/App.config", "localhost", args.database_host)
  10. subprocess.check_call("powershell -Command .\\setup.ps1 start", cwd="HttpListener", stderr=errfile, stdout=logfile)
  11. return 0
  12. except subprocess.CalledProcessError:
  13. return 1
  14. def stop(logfile, errfile):
  15. if os.name != 'nt':
  16. return 0
  17. subprocess.check_call("powershell -Command .\\setup.ps1 stop", cwd="HttpListener", stderr=errfile, stdout=logfile)
  18. return 0