You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

twistd.py 867B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- test-case-name: twisted.test.test_twistd -*-
  2. # Copyright (c) Twisted Matrix Laboratories.
  3. # See LICENSE for details.
  4. """
  5. The Twisted Daemon: platform-independent interface.
  6. @author: Christopher Armstrong
  7. """
  8. from __future__ import absolute_import, division
  9. from twisted.application import app
  10. from twisted.python.runtime import platformType
  11. if platformType == "win32":
  12. from twisted.scripts._twistw import ServerOptions, \
  13. WindowsApplicationRunner as _SomeApplicationRunner
  14. else:
  15. from twisted.scripts._twistd_unix import ServerOptions, \
  16. UnixApplicationRunner as _SomeApplicationRunner
  17. def runApp(config):
  18. runner = _SomeApplicationRunner(config)
  19. runner.run()
  20. if runner._exitSignal is not None:
  21. app._exitWithSignal(runner._exitSignal)
  22. def run():
  23. app.run(runApp, ServerOptions)
  24. __all__ = ['run', 'runApp']