Changeset 1926
- Timestamp:
- 03/16/08 17:29:06
- Files:
-
- trunk/cherrypy/__init__.py (modified) (2 diffs)
- trunk/cherrypy/_cpserver.py (modified) (1 diff)
- trunk/cherrypy/cherryd.py (modified) (1 diff)
- trunk/cherrypy/lib/sessions.py (modified) (1 diff)
- trunk/cherrypy/process/__init__.py (modified) (1 diff)
- trunk/cherrypy/process/plugins.py (modified) (1 diff)
- trunk/cherrypy/process/win32.py (modified) (4 diffs)
- trunk/cherrypy/scaffold/cpdeploy.py (modified) (1 diff)
- trunk/cherrypy/test/test_states_demo.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1868 r1926 179 179 from cherrypy import _cpwsgi as wsgi 180 180 181 from cherrypy import restsrv181 from cherrypy import process 182 182 try: 183 from cherrypy. restsrv import win32 as _restsrvwin184 engine = _restsrvwin.Win32Bus()185 _console_control_handler = _restsrvwin.ConsoleCtrlHandler(engine)183 from cherrypy.process import win32 184 engine = win32.Win32Bus() 185 _console_control_handler = win32.ConsoleCtrlHandler(engine) 186 186 # If you don't want a ConsoleControlHandler, 187 187 # unsubscribe this before calling engine.start(). 188 188 _console_control_handler.subscribe() 189 del win32 189 190 except ImportError: 190 engine = restsrv.bus191 engine = process.bus 191 192 192 193 193 194 # Timeout monitor 194 class _TimeoutMonitor( restsrv.plugins.Monitor):195 class _TimeoutMonitor(process.plugins.Monitor): 195 196 196 197 def __init__(self, bus): 197 198 self.servings = [] 198 restsrv.plugins.Monitor.__init__(self, bus, self.run)199 process.plugins.Monitor.__init__(self, bus, self.run) 199 200 200 201 def acquire(self): … … 215 216 216 217 # Add an autoreloader (the 'engine' config namespace may detach/attach it). 217 engine.autoreload = restsrv.plugins.Autoreloader(engine)218 engine.autoreload = process.plugins.Autoreloader(engine) 218 219 engine.autoreload.subscribe() 219 220 220 restsrv.plugins.ThreadManager(engine).subscribe()221 222 signal_handler = restsrv.plugins.SignalHandler(engine)221 process.plugins.ThreadManager(engine).subscribe() 222 223 signal_handler = process.plugins.SignalHandler(engine) 223 224 224 225 from cherrypy import _cpserver trunk/cherrypy/_cpserver.py
r1837 r1926 9 9 # We import * because we want to export check_port 10 10 # et al as attributes of this module. 11 from cherrypy. restsrv.servers import *11 from cherrypy.process.servers import * 12 12 13 13 trunk/cherrypy/cherryd.py
r1887 r1926 6 6 7 7 import cherrypy 8 from cherrypy. restsrvimport plugins8 from cherrypy.process import plugins 9 9 10 10 trunk/cherrypy/lib/sessions.py
r1924 r1926 147 147 # clean_up is in instancemethod and not a classmethod, 148 148 # so that tool config can be accessed inside the method. 149 t = cherrypy. restsrv.plugins.Monitor(149 t = cherrypy.process.plugins.Monitor( 150 150 cherrypy.engine, self.clean_up, self.clean_freq * 60) 151 151 t.subscribe() trunk/cherrypy/process/__init__.py
r1691 r1926 11 11 """ 12 12 13 from cherrypy. restsrv.wspbus import bus14 from cherrypy. restsrvimport plugins, servers13 from cherrypy.process.wspbus import bus 14 from cherrypy.process import plugins, servers trunk/cherrypy/process/plugins.py
r1896 r1926 353 353 """Start our callback in its own perpetual timer thread.""" 354 354 if self.frequency > 0: 355 threadname = "restsrv %s" %self.__class__.__name__355 threadname = self.__class__.__name__ 356 356 if self.thread is None: 357 357 self.thread = PerpetualTimer(self.frequency, self.callback) trunk/cherrypy/process/win32.py
r1842 r1926 1 """Windows service for restsrv. Requires pywin32."""1 """Windows service. Requires pywin32.""" 2 2 3 3 import os … … 9 9 import win32serviceutil 10 10 11 from cherrypy. restsrvimport wspbus, plugins11 from cherrypy.process import wspbus, plugins 12 12 13 13 … … 143 143 _svc_display_name_ = "Python Web Service" 144 144 _svc_deps_ = None # sequence of service names on which this depends 145 _exe_name_ = " restsrv"145 _exe_name_ = "pywebsvc" 146 146 _exe_args_ = None # Default to no arguments 147 147 … … 150 150 151 151 def SvcDoRun(self): 152 from cherrypy import restsrv153 restsrv.bus.start()154 restsrv.bus.block()152 from cherrypy import process 153 process.bus.start() 154 process.bus.block() 155 155 156 156 def SvcStop(self): 157 from cherrypy import restsrv157 from cherrypy import process 158 158 self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) 159 restsrv.bus.exit()159 process.bus.exit() 160 160 161 161 def SvcOther(self, control): 162 restsrv.bus.publish(control_codes.key_for(control))162 process.bus.publish(control_codes.key_for(control)) 163 163 164 164 trunk/cherrypy/scaffold/cpdeploy.py
r1864 r1926 12 12 13 13 import cherrypy 14 from cherrypy. restsrv.plugins import Daemonizer, PIDFile14 from cherrypy.process.plugins import Daemonizer, PIDFile 15 15 16 16 # TODO: Change this to import your project root. trunk/cherrypy/test/test_states_demo.py
r1830 r1926 5 5 6 6 import cherrypy 7 from cherrypy. restsrvimport plugins7 from cherrypy.process import plugins 8 8 thisdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) 9 9 PID_file_path = os.path.join(thisdir, 'pid_for_test_daemonize')

