| OLD | NEW |
| (Empty) |
| 1 # -*- test-case-name: twisted.test.test_twistd -*- | |
| 2 # Copyright (c) 2001-2008 Twisted Matrix Laboratories. | |
| 3 # See LICENSE for details. | |
| 4 | |
| 5 """ | |
| 6 The Twisted Daemon: platform-independent interface. | |
| 7 | |
| 8 @author: U{Christopher Armstrong<mailto:radix@twistedmatrix.com>} | |
| 9 """ | |
| 10 | |
| 11 from twisted.application import app | |
| 12 | |
| 13 from twisted.python.runtime import platformType | |
| 14 if platformType == "win32": | |
| 15 from twisted.scripts._twistw import ServerOptions, \ | |
| 16 WindowsApplicationRunner as _SomeApplicationRunner | |
| 17 else: | |
| 18 from twisted.scripts._twistd_unix import ServerOptions, \ | |
| 19 UnixApplicationRunner as _SomeApplicationRunner | |
| 20 | |
| 21 | |
| 22 def runApp(config): | |
| 23 _SomeApplicationRunner(config).run() | |
| 24 | |
| 25 | |
| 26 def run(): | |
| 27 app.run(runApp, ServerOptions) | |
| 28 | |
| 29 | |
| 30 __all__ = ['run', 'runApp'] | |
| OLD | NEW |