Commits

Robert Brewer committed b7b8790

Renamed restsrv -> process in all referrers.

Comments (0)

Files changed (9)

cherrypy/__init__.py

 from cherrypy._cptree import Application
 from cherrypy import _cpwsgi as wsgi
 
-from cherrypy import restsrv
+from cherrypy import process
 try:
-    from cherrypy.restsrv import win32 as _restsrvwin
-    engine = _restsrvwin.Win32Bus()
-    _console_control_handler = _restsrvwin.ConsoleCtrlHandler(engine)
+    from cherrypy.process import win32
+    engine = win32.Win32Bus()
+    _console_control_handler = win32.ConsoleCtrlHandler(engine)
     # If you don't want a ConsoleControlHandler,
     # unsubscribe this before calling engine.start().
     _console_control_handler.subscribe()
+    del win32
 except ImportError:
-    engine = restsrv.bus
+    engine = process.bus
 
 
 # Timeout monitor
-class _TimeoutMonitor(restsrv.plugins.Monitor):
+class _TimeoutMonitor(process.plugins.Monitor):
     
     def __init__(self, bus):
         self.servings = []
-        restsrv.plugins.Monitor.__init__(self, bus, self.run)
+        process.plugins.Monitor.__init__(self, bus, self.run)
     
     def acquire(self):
         self.servings.append((serving.request, serving.response))
 timeout_monitor.subscribe()
 
 # Add an autoreloader (the 'engine' config namespace may detach/attach it).
-engine.autoreload = restsrv.plugins.Autoreloader(engine)
+engine.autoreload = process.plugins.Autoreloader(engine)
 engine.autoreload.subscribe()
 
-restsrv.plugins.ThreadManager(engine).subscribe()
+process.plugins.ThreadManager(engine).subscribe()
 
-signal_handler = restsrv.plugins.SignalHandler(engine)
+signal_handler = process.plugins.SignalHandler(engine)
 
 from cherrypy import _cpserver
 server = _cpserver.Server()

cherrypy/_cpserver.py

 
 # We import * because we want to export check_port
 # et al as attributes of this module.
-from cherrypy.restsrv.servers import *
+from cherrypy.process.servers import *
 
 
 class Server(ServerAdapter):

cherrypy/cherryd.py

 import sys
 
 import cherrypy
-from cherrypy.restsrv import plugins
+from cherrypy.process import plugins
 
 
 shortopts = ["d", "e"]

cherrypy/lib/sessions.py

         if not cls.clean_thread:
             # clean_up is in instancemethod and not a classmethod,
             # so that tool config can be accessed inside the method.
-            t = cherrypy.restsrv.plugins.Monitor(
+            t = cherrypy.process.plugins.Monitor(
                 cherrypy.engine, self.clean_up, self.clean_freq * 60)
             t.subscribe()
             cls.clean_thread = t

cherrypy/process/__init__.py

 for each class.
 """
 
-from cherrypy.restsrv.wspbus import bus
-from cherrypy.restsrv import plugins, servers
+from cherrypy.process.wspbus import bus
+from cherrypy.process import plugins, servers

cherrypy/process/plugins.py

     def start(self):
         """Start our callback in its own perpetual timer thread."""
         if self.frequency > 0:
-            threadname = "restsrv %s" % self.__class__.__name__
+            threadname = self.__class__.__name__
             if self.thread is None:
                 self.thread = PerpetualTimer(self.frequency, self.callback)
                 self.thread.setName(threadname)

cherrypy/process/win32.py

-"""Windows service for restsrv. Requires pywin32."""
+"""Windows service. Requires pywin32."""
 
 import os
 import thread
 import win32service
 import win32serviceutil
 
-from cherrypy.restsrv import wspbus, plugins
+from cherrypy.process import wspbus, plugins
 
 
 class ConsoleCtrlHandler(plugins.SimplePlugin):
     _svc_name_ = "Python Web Service"
     _svc_display_name_ = "Python Web Service"
     _svc_deps_ = None        # sequence of service names on which this depends
-    _exe_name_ = "restsrv"
+    _exe_name_ = "pywebsvc"
     _exe_args_ = None        # Default to no arguments
     
     # Only exists on Windows 2000 or later, ignored on windows NT
     _svc_description_ = "Python Web Service"
     
     def SvcDoRun(self):
-        from cherrypy import restsrv
-        restsrv.bus.start()
-        restsrv.bus.block()
+        from cherrypy import process
+        process.bus.start()
+        process.bus.block()
     
     def SvcStop(self):
-        from cherrypy import restsrv
+        from cherrypy import process
         self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
-        restsrv.bus.exit()
+        process.bus.exit()
     
     def SvcOther(self, control):
-        restsrv.bus.publish(control_codes.key_for(control))
+        process.bus.publish(control_codes.key_for(control))
 
 
 if __name__ == '__main__':

cherrypy/scaffold/cpdeploy.py

 local_dir = os.path.join(os.getcwd(), os.path.dirname(__file__))
 
 import cherrypy
-from cherrypy.restsrv.plugins import Daemonizer, PIDFile
+from cherrypy.process.plugins import Daemonizer, PIDFile
 
 # TODO: Change this to import your project root.
 from cherrypy import scaffold

cherrypy/test/test_states_demo.py

 starttime = time.time()
 
 import cherrypy
-from cherrypy.restsrv import plugins
+from cherrypy.process import plugins
 thisdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
 PID_file_path = os.path.join(thisdir, 'pid_for_test_daemonize')