Changeset 1639
- Timestamp:
- 03/13/07 19:04:14
- Files:
-
- trunk/cherrypy/__init__.py (modified) (3 diffs)
- trunk/cherrypy/lib/sessions.py (modified) (1 diff)
- trunk/cherrypy/restsrv (moved) (moved from trunk/cherrypy/pywebd)
- trunk/cherrypy/restsrv/__init__.py (modified) (1 diff)
- trunk/cherrypy/restsrv/base.py (modified) (1 diff)
- trunk/cherrypy/restsrv/plugins.py (modified) (2 diffs)
- trunk/cherrypy/restsrv/restctl (added)
- trunk/cherrypy/restsrv/restd.py (added)
- trunk/cherrypy/restsrv/win32.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1627 r1639 174 174 server = _cpserver.Server() 175 175 176 from cherrypy import pywebd177 engine = pywebd.engine176 from cherrypy import restsrv 177 engine = restsrv.engine 178 178 179 179 # Timeout monitor 180 class _TimeoutMonitor( pywebd.plugins.Monitor):180 class _TimeoutMonitor(restsrv.plugins.Monitor): 181 181 182 182 def __init__(self, engine, channel=None): 183 183 self.servings = [] 184 pywebd.plugins.Monitor.__init__(self, engine, self.run, channel)184 restsrv.plugins.Monitor.__init__(self, engine, self.run, channel) 185 185 186 186 def acquire(self): … … 200 200 201 201 # Add an autoreloader (the 'engine' config namespace may detach/attach it). 202 engine.autoreload = pywebd.plugins.Autoreloader(engine)203 pywebd.plugins.Reexec(engine)204 _thread_manager = pywebd.plugins.ThreadManager(engine)202 engine.autoreload = restsrv.plugins.Autoreloader(engine) 203 restsrv.plugins.Reexec(engine) 204 _thread_manager = restsrv.plugins.ThreadManager(engine) 205 205 206 206 … … 213 213 engine.subscribe('start', server.quickstart) 214 214 215 s = pywebd.plugins.SignalHandler(engine)215 s = restsrv.plugins.SignalHandler(engine) 216 216 s.set_handler('SIGTERM', engine.stop) 217 217 s.set_handler('SIGHUP', engine.restart) trunk/cherrypy/lib/sessions.py
r1627 r1639 114 114 # clean_up is in instancemethod and not a classmethod, 115 115 # so tool config can be accessed inside the method. 116 from cherrypy import pywebd117 t = pywebd.plugins.Monitor(cherrypy.engine, self.clean_up,118 "CP Session Cleanup")116 from cherrypy import restsrv 117 t = restsrv.plugins.Monitor(cherrypy.engine, self.clean_up, 118 "CP Session Cleanup") 119 119 t.frequency = self.clean_freq 120 120 cls.clean_thread = t trunk/cherrypy/restsrv/__init__.py
r1627 r1639 40 40 """ 41 41 42 from cherrypy. pywebdimport plugins42 from cherrypy.restsrv import plugins 43 43 44 44 try: 45 from cherrypy. pywebdimport win3245 from cherrypy.restsrv import win32 46 46 engine = win32.Engine() 47 47 except ImportError: 48 from cherrypy. pywebdimport base48 from cherrypy.restsrv import base 49 49 engine = base.Engine() trunk/cherrypy/restsrv/base.py
r1631 r1639 1 """Base Engine class for pywebd."""1 """Base Engine class for restsrv.""" 2 2 3 3 try: trunk/cherrypy/restsrv/plugins.py
r1632 r1639 1 """Plugins for a pywebdEngine."""1 """Plugins for a restsrv Engine.""" 2 2 3 3 import os … … 296 296 if self.frequency > 0: 297 297 self.thread = PerpetualTimer(self.frequency, self.callback) 298 self.thread.setName(" pywebd%s" % self.channel)298 self.thread.setName("restsrv %s" % self.channel) 299 299 self.thread.start() 300 300 trunk/cherrypy/restsrv/win32.py
r1627 r1639 1 """Windows service for pywebd. Requires pywin32."""1 """Windows service for restsrv. Requires pywin32.""" 2 2 3 3 import win32serviceutil … … 7 7 import win32api 8 8 9 from cherrypy. pywebdimport base9 from cherrypy.restsrv import base 10 10 11 11 … … 52 52 _svc_display_name_ = "Python Web Service" 53 53 _svc_deps_ = None # sequence of service names on which this depends 54 _exe_name_ = " pywebd"54 _exe_name_ = "restsrv" 55 55 _exe_args_ = None # Default to no arguments 56 56 … … 59 59 60 60 def SvcDoRun(self): 61 from cherrypy import pywebd62 pywebd.engine.start()63 pywebd.engine.block()61 from cherrypy import restsrv 62 restsrv.engine.start() 63 restsrv.engine.block() 64 64 65 65 def SvcStop(self): 66 from cherrypy import pywebd66 from cherrypy import restsrv 67 67 self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) 68 pywebd.engine.stop()68 restsrv.engine.stop() 69 69 70 70 if __name__ == '__main__':

