summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-03-16 22:29:06 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-03-16 22:29:06 +0000
commit35e357a3e69a8c8185390cf464c60d76f2994314 (patch)
tree42a396bc588c0101b052769a12568f741a65ba5c
parentd5670351b780e87fd05c98a488e5e54eee7765b5 (diff)
downloadcherrypy-35e357a3e69a8c8185390cf464c60d76f2994314.tar.gz
Renamed restsrv -> process in all referrers.
-rw-r--r--cherrypy/__init__.py21
-rw-r--r--cherrypy/_cpserver.py2
-rw-r--r--cherrypy/cherryd.py2
-rw-r--r--cherrypy/lib/sessions.py2
-rw-r--r--cherrypy/process/__init__.py4
-rw-r--r--cherrypy/process/plugins.py2
-rw-r--r--cherrypy/process/win32.py18
-rw-r--r--cherrypy/scaffold/cpdeploy.py2
-rw-r--r--cherrypy/test/test_states_demo.py2
9 files changed, 28 insertions, 27 deletions
diff --git a/cherrypy/__init__.py b/cherrypy/__init__.py
index 4ed28114..217b00ba 100644
--- a/cherrypy/__init__.py
+++ b/cherrypy/__init__.py
@@ -178,24 +178,25 @@ tree = _cptree.Tree()
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))
@@ -214,12 +215,12 @@ timeout_monitor = _TimeoutMonitor(engine)
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()
diff --git a/cherrypy/_cpserver.py b/cherrypy/_cpserver.py
index 6b7107c8..17e51610 100644
--- a/cherrypy/_cpserver.py
+++ b/cherrypy/_cpserver.py
@@ -8,7 +8,7 @@ from cherrypy.lib import attributes
# 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):
diff --git a/cherrypy/cherryd.py b/cherrypy/cherryd.py
index 494dbd6b..011fa353 100644
--- a/cherrypy/cherryd.py
+++ b/cherrypy/cherryd.py
@@ -5,7 +5,7 @@ import getopt
import sys
import cherrypy
-from cherrypy.restsrv import plugins
+from cherrypy.process import plugins
shortopts = ["d", "e"]
diff --git a/cherrypy/lib/sessions.py b/cherrypy/lib/sessions.py
index aa64d40e..d75d355e 100644
--- a/cherrypy/lib/sessions.py
+++ b/cherrypy/lib/sessions.py
@@ -146,7 +146,7 @@ class Session(object):
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
diff --git a/cherrypy/process/__init__.py b/cherrypy/process/__init__.py
index 3e28ab4b..f15b1237 100644
--- a/cherrypy/process/__init__.py
+++ b/cherrypy/process/__init__.py
@@ -10,5 +10,5 @@ use with the bus. Some use tool-specific channels; see the documentation
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
diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index a4dbcec9..e67ea31f 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -352,7 +352,7 @@ class Monitor(SimplePlugin):
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)
diff --git a/cherrypy/process/win32.py b/cherrypy/process/win32.py
index 438337f9..0f8d2f45 100644
--- a/cherrypy/process/win32.py
+++ b/cherrypy/process/win32.py
@@ -1,4 +1,4 @@
-"""Windows service for restsrv. Requires pywin32."""
+"""Windows service. Requires pywin32."""
import os
import thread
@@ -8,7 +8,7 @@ import win32event
import win32service
import win32serviceutil
-from cherrypy.restsrv import wspbus, plugins
+from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
@@ -142,24 +142,24 @@ class PyWebService(win32serviceutil.ServiceFramework):
_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__':
diff --git a/cherrypy/scaffold/cpdeploy.py b/cherrypy/scaffold/cpdeploy.py
index 32e1fe51..1fc9378a 100644
--- a/cherrypy/scaffold/cpdeploy.py
+++ b/cherrypy/scaffold/cpdeploy.py
@@ -11,7 +11,7 @@ import os
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
diff --git a/cherrypy/test/test_states_demo.py b/cherrypy/test/test_states_demo.py
index 0937b3d1..8aea9716 100644
--- a/cherrypy/test/test_states_demo.py
+++ b/cherrypy/test/test_states_demo.py
@@ -4,7 +4,7 @@ import time
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')