Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / python2.7 / dist-packages / twisted / scripts / | server ip : 104.21.89.46 your ip : 108.162.216.72 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.py |
Size | 1.42 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 14-Feb-2011 11:45 |
Last accessed | 06-Jul-2025 17:19 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
# -*- test-case-name: twisted.test.test_twistd -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.python import log
from twisted.application import app, service, internet
from twisted import copyright
import sys, os
class ServerOptions(app.ServerOptions):
synopsis = "Usage: twistd [options]"
optFlags = [['nodaemon','n', "(for backwards compatability)."],
]
def opt_version(self):
"""Print version information and exit.
"""
print 'twistd (the Twisted Windows runner) %s' % copyright.version
print copyright.copyright
sys.exit()
class WindowsApplicationRunner(app.ApplicationRunner):
"""
An ApplicationRunner which avoids unix-specific things. No
forking, no PID files, no privileges.
"""
def preApplication(self):
"""
Do pre-application-creation setup.
"""
self.oldstdout = sys.stdout
self.oldstderr = sys.stderr
os.chdir(self.config['rundir'])
def postApplication(self):
"""
Start the application and run the reactor.
"""
service.IService(self.application).privilegedStartService()
app.startApplication(self.application, not self.config['no_save'])
app.startApplication(internet.TimerService(0.1, lambda:None), 0)
self.startReactor(None, self.oldstdout, self.oldstderr)
log.msg("Server Shut Down.")
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.python import log
from twisted.application import app, service, internet
from twisted import copyright
import sys, os
class ServerOptions(app.ServerOptions):
synopsis = "Usage: twistd [options]"
optFlags = [['nodaemon','n', "(for backwards compatability)."],
]
def opt_version(self):
"""Print version information and exit.
"""
print 'twistd (the Twisted Windows runner) %s' % copyright.version
print copyright.copyright
sys.exit()
class WindowsApplicationRunner(app.ApplicationRunner):
"""
An ApplicationRunner which avoids unix-specific things. No
forking, no PID files, no privileges.
"""
def preApplication(self):
"""
Do pre-application-creation setup.
"""
self.oldstdout = sys.stdout
self.oldstderr = sys.stderr
os.chdir(self.config['rundir'])
def postApplication(self):
"""
Start the application and run the reactor.
"""
service.IService(self.application).privilegedStartService()
app.startApplication(self.application, not self.config['no_save'])
app.startApplication(internet.TimerService(0.1, lambda:None), 0)
self.startReactor(None, self.oldstdout, self.oldstderr)
log.msg("Server Shut Down.")