Changeset 1092
- Timestamp:
- 05/04/06 02:44:59
- Files:
-
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/_cpengine.py (modified) (15 diffs)
- trunk/cherrypy/_cpserver.py (modified) (4 diffs)
- trunk/cherrypy/_cpwsgi.py (modified) (1 diff)
- trunk/cherrypy/lib/covercp.py (modified) (1 diff)
- trunk/cherrypy/lib/profiler.py (modified) (1 diff)
- trunk/cherrypy/test/benchmark.py (modified) (3 diffs)
- trunk/cherrypy/test/helper.py (modified) (2 diffs)
- trunk/cherrypy/test/modpy.py (modified) (1 diff)
- trunk/cherrypy/test/test_noserver.py (modified) (1 diff)
- trunk/cherrypy/test/test_session_concurrency.py (modified) (2 diffs)
- trunk/cherrypy/test/test_states.py (modified) (11 diffs)
- trunk/cherrypy/tutorial/bonus-sqlobject.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut01_helloworld.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut02_expose_methods.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut03_get_and_post.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut04_complex_site.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut05_derived_objects.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut06_default_method.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut07_sessions.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut08_generators_and_yield.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut09_files.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut10_http_errors.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tutorial.conf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1091 r1092 14 14 tree = _cptree.Tree() 15 15 16 # Legacy code may clobber this.17 16 root = None 18 17 18 import _cpengine 19 engine = _cpengine.Engine() 19 20 import _cpserver 20 21 server = _cpserver.Server() trunk/cherrypy/_cpengine.py
r1070 r1092 1 """Create and manage the CherryPy application serverengine."""1 """Create and manage the CherryPy application engine.""" 2 2 3 3 import cgi … … 5 5 import threading 6 6 import time 7 import warnings8 7 9 8 import cherrypy … … 11 10 from cherrypy.lib import autoreload, profiler, cptools 12 11 13 # Use a flag to indicate the state of the application server.12 # Use a flag to indicate the state of the application engine. 14 13 STOPPED = 0 15 14 STARTING = None … … 18 17 19 18 class Engine(object): 20 """The application server engine, connecting HTTP servers to Requests."""19 """The application engine, which exposes a request interface to (HTTP) servers.""" 21 20 22 21 request_class = _cprequest.Request … … 25 24 def __init__(self): 26 25 self.state = STOPPED 27 28 self.seen_threads = {}29 26 self.interrupt = None 30 27 31 28 # Startup/shutdown hooks 32 self.on_start_ server_list = []33 self.on_stop_ server_list = []29 self.on_start_engine_list = [] 30 self.on_stop_engine_list = [] 34 31 self.on_start_thread_list = [] 35 32 self.on_stop_thread_list = [] 36 37 def setup(self): 38 # The only reason this method isn't in __init__ is so that 39 # "import cherrypy" can create an Engine() without a circular ref. 33 self.seen_threads = {} 34 35 def start(self, blocking=True): 36 """Start the application engine.""" 37 self.state = STARTING 38 self.interrupt = None 39 40 40 conf = cherrypy.config.get 41 41 … … 57 57 covercp.start() 58 58 59 # If sessions are stored in files and we60 # use threading, we need a lock on the file61 if (conf('server.thread_pool') > 162 and conf('session.storage_type') == 'file'):63 cherrypy._sessionFileLock = threading.RLock()64 65 59 # set cgi.maxlen which will limit the size of POST request bodies 66 60 cgi.maxlen = conf('server.max_request_size') … … 73 67 cherrypy.profiler = None 74 68 75 def start(self):76 """Start the application server engine."""77 self.state = STARTING78 self.interrupt = None79 80 conf = cherrypy.config.get81 82 69 # Autoreload. Note that, if we're not starting our own HTTP server, 83 70 # autoreload could do Very Bad Things when it calls sys.exit, but … … 86 73 try: 87 74 freq = conf('autoreload.frequency', 1) 88 autoreload.main(self._start, freq=freq)75 autoreload.main(self._start, args=(blocking,), freq=freq) 89 76 except KeyboardInterrupt: 90 77 cherrypy.log("<Ctrl-C> hit: shutting down autoreloader", "ENGINE") 78 cherrypy.server.stop() 91 79 self.stop() 92 80 except SystemExit: 93 81 cherrypy.log("SystemExit raised: shutting down autoreloader", "ENGINE") 82 cherrypy.server.stop() 94 83 self.stop() 95 84 # We must raise here: if this is a process spawned by … … 99 88 return 100 89 101 self._start() 102 103 def _start(self): 104 for func in self.on_start_server_list: 90 self._start(blocking) 91 92 def _start(self, blocking=True): 93 # This is in a separate function so autoreload can call it. 94 for func in self.on_start_engine_list: 105 95 func() 106 96 self.state = STARTED 97 if blocking: 98 self.block() 107 99 108 100 def block(self): … … 114 106 raise self.interrupt 115 107 except KeyboardInterrupt: 116 cherrypy.log("<Ctrl-C> hit: shutting down app server", "ENGINE") 108 cherrypy.log("<Ctrl-C> hit: shutting down app engine", "ENGINE") 109 cherrypy.server.stop() 117 110 self.stop() 118 111 except SystemExit: 119 cherrypy.log("SystemExit raised: shutting down app server", "ENGINE") 112 cherrypy.log("SystemExit raised: shutting down app engine", "ENGINE") 113 cherrypy.server.stop() 120 114 self.stop() 121 115 raise … … 123 117 # Don't bother logging, since we're going to re-raise. 124 118 self.interrupt = sys.exc_info()[1] 119 # Note that we don't stop the HTTP server here. 125 120 self.stop() 126 121 raise 127 122 128 123 def stop(self): 129 """Stop the application serverengine."""124 """Stop the application engine.""" 130 125 for thread_ident, i in self.seen_threads.iteritems(): 131 126 for func in self.on_stop_thread_list: … … 133 128 self.seen_threads.clear() 134 129 135 for func in self.on_stop_ server_list:130 for func in self.on_stop_engine_list: 136 131 func() 137 132 … … 140 135 141 136 def restart(self): 142 """Restart the application server engine."""137 """Restart the application engine (doesn't block).""" 143 138 self.stop() 144 self.start( )139 self.start(blocking=False) 145 140 146 141 def wait(self): … … 149 144 time.sleep(.1) 150 145 if self.interrupt: 151 msg = "The CherryPy application servererrored"146 msg = "The CherryPy application engine errored" 152 147 raise cherrypy.NotReady(msg, "ENGINE") 153 148 154 149 def _is_ready(self): 155 150 return bool(self.state == STARTED) 156 ready = property(_is_ready, doc="Return True if the serveris ready to"151 ready = property(_is_ready, doc="Return True if the engine is ready to" 157 152 " receive requests, False otherwise.") 158 153 159 def request(self, client Address, remote_host, scheme="http"):154 def request(self, client_address, remote_host, scheme="http"): 160 155 """Obtain an HTTP Request object. 161 156 162 client Address: the (IP address, port) of the client157 client_address: the (IP address, port) of the client 163 158 remote_host: the IP address of the client 164 159 scheme: either "http" or "https"; defaults to "http" 165 160 """ 166 161 if self.state == STOPPED: 167 raise cherrypy.NotReady("The CherryPy serverhas stopped.")162 raise cherrypy.NotReady("The CherryPy engine has stopped.") 168 163 elif self.state == STARTING: 169 raise cherrypy.NotReady("The CherryPy servercould not start.")164 raise cherrypy.NotReady("The CherryPy engine could not start.") 170 165 171 166 threadID = threading._get_ident() … … 182 177 func(i) 183 178 184 r = self.request_class(client Address[0], clientAddress[1],179 r = self.request_class(client_address[0], client_address[1], 185 180 remote_host, scheme) 186 181 cherrypy.serving.request = r 187 182 cherrypy.serving.response = self.response_class() 188 183 return r 189 184 185 def start_with_callback(self, func, args=None, kwargs=None): 186 """Start, then callback the given func in a new thread.""" 187 188 if args is None: 189 args = () 190 if kwargs is None: 191 kwargs = {} 192 args = (func,) + args 193 194 def _callback(func, *a, **kw): 195 self.wait() 196 func(*a, **kw) 197 t = threading.Thread(target=_callback, args=args, kwargs=kwargs) 198 t.setName("CPEngine Callback " + t.getName()) 199 t.start() 200 201 self.start() 202 trunk/cherrypy/_cpserver.py
r1047 r1092 1 """ Create and manage the CherryPy server."""1 """Manage an HTTP server with CherryPy.""" 2 2 3 3 import threading … … 6 6 import cherrypy 7 7 from cherrypy.lib import cptools 8 from cherrypy._cpengine import Engine, STOPPED, STARTING, STARTED9 10 _missing = object()11 8 12 9 13 class Server(Engine): 10 class Server(object): 11 """Manager for an HTTP server.""" 14 12 15 13 def __init__(self): 16 Engine.__init__(self)17 self._is_setup = False18 self.blocking = True19 20 14 self.httpserver = None 15 self.interrupt = None 21 16 22 def start(self, init_only=False, server_class=_missing, server=None, **kwargs): 23 """Main function. MUST be called from the main thread. 24 25 Set initOnly to True to keep this function from blocking. 26 Set serverClass and server to None to skip starting any HTTP server. 27 """ 28 17 def start(self, server=None): 18 """Main function. MUST be called from the main thread.""" 29 19 conf = cherrypy.config.get 30 31 if not init_only:32 init_only = conf('server.init_only', False)33 34 20 if server is None: 35 21 server = conf('server.instance', None) 36 22 if server is None: 37 if server_class is _missing: 38 server_class = conf("server.class", _missing) 39 if server_class is _missing: 40 import _cpwsgi 41 server_class = _cpwsgi.WSGIServer 42 elif server_class and isinstance(server_class, basestring): 43 # Dynamically load the class from the given string 44 server_class = cptools.attributes(server_class) 45 if server_class is not None: 46 self.httpserver = server_class() 47 else: 48 if isinstance(server, basestring): 49 server = cptools.attributes(server) 50 self.httpserver = server 23 import _cpwsgi 24 server = _cpwsgi.WSGIServer() 25 if isinstance(server, basestring): 26 server = cptools.attributes(server)() 27 self.httpserver = server 51 28 52 self.blocking = not init_only 53 Engine.start(self) 54 55 def _start(self): 56 if not self._is_setup: 57 self.setup() 58 self._is_setup = True 59 Engine._start(self) 60 self.start_http_server() 61 if self.blocking: 62 self.block() 63 64 def restart(self): 65 """Restart the application server engine.""" 66 self.stop() 67 self.state = STARTING 68 self.interrupt = None 69 self._start() 70 71 def start_http_server(self, blocking=True): 72 """Start the requested HTTP server.""" 73 if not self.httpserver: 74 return 75 76 if cherrypy.config.get('server.socket_port'): 77 host = cherrypy.config.get('server.socket_host') 78 port = cherrypy.config.get('server.socket_port') 79 29 if conf('server.socket_port'): 30 host = conf('server.socket_host') 31 port = conf('server.socket_port') 80 32 wait_for_free_port(host, port) 81 82 33 if not host: 83 34 host = 'localhost' 84 35 on_what = "http://%s:%s/" % (host, port) 85 36 else: 86 on_what = "socket file: %s" % c herrypy.config.get('server.socket_file')37 on_what = "socket file: %s" % conf('server.socket_file') 87 38 88 39 # HTTP servers MUST be started in a new thread, so that the 89 40 # main thread persists to receive KeyboardInterrupt's. If an 90 # exception is raised in the http server's main thread then it's 91 # trapped here, and the CherryPy app server is shut down (via 92 # self.interrupt). 41 # exception is raised in the http server's thread then it's 42 # trapped here, and the http server and engine are shut down. 93 43 def _start_http(): 94 44 try: 95 45 self.httpserver.start() 96 46 except KeyboardInterrupt, exc: 47 cherrypy.log("<Ctrl-C> hit: shutting down HTTP server", "SERVER") 97 48 self.interrupt = exc 98 49 self.stop() 50 cherrypy.engine.stop() 99 51 except SystemExit, exc: 52 cherrypy.log("SystemExit raised: shutting down HTTP server", "SERVER") 100 53 self.interrupt = exc 101 54 self.stop() 55 cherrypy.engine.stop() 102 56 raise 103 57 t = threading.Thread(target=_start_http) … … 105 59 t.start() 106 60 107 if blocking: 108 self.wait_for_http_ready() 109 61 self.wait() 110 62 cherrypy.log("Serving HTTP on %s" % on_what, 'HTTP') 111 63 112 64 def wait(self): 113 """Block the caller until ready to receive requests (or error).""" 114 Engine.wait(self) 115 self.wait_for_http_ready() 116 117 def wait_for_http_ready(self): 118 if self.httpserver: 119 while (not getattr(self.httpserver, "ready", True) 120 and not self.interrupt 121 and self.state != STOPPED): 122 time.sleep(.1) 65 """Wait until the HTTP server is ready to receive requests.""" 66 while (not getattr(self.httpserver, "ready", True) 67 and not self.interrupt): 68 time.sleep(.1) 69 70 # Wait for port to be occupied 71 if cherrypy.config.get('server.socket_port'): 72 host = cherrypy.config.get('server.socket_host') 73 port = cherrypy.config.get('server.socket_port') 74 if not host: 75 host = 'localhost' 123 76 124 # Wait for port to be occupied 125 if cherrypy.config.get('server.socket_port'): 126 host = cherrypy.config.get('server.socket_host') 127 port = cherrypy.config.get('server.socket_port') 128 if not host: 129 host = 'localhost' 130 131 for trial in xrange(50): 132 if self.interrupt: 133 break 134 try: 135 check_port(host, port) 136 except IOError: 137 break 138 else: 139 time.sleep(.1) 77 for trial in xrange(50): 78 if self.interrupt: 79 break 80 try: 81 check_port(host, port) 82 except IOError: 83 break 140 84 else: 141 cherrypy.log("Port %s not bound on %s" % 142 (repr(port), repr(host)), 'HTTP') 143 raise cherrypy.NotReady("Port not bound.") 85 time.sleep(.1) 86 else: 87 cherrypy.log("Port %s not bound on %s" % 88 (repr(port), repr(host)), 'HTTP') 89 raise cherrypy.NotReady("Port not bound.") 144 90 145 91 def stop(self): 146 """Stop, including any HTTP servers."""147 self.stop_http_server()148 Engine.stop(self)149 150 def stop_http_server(self):151 92 """Stop the HTTP server.""" 152 93 try: … … 159 100 cherrypy.log("HTTP Server shut down", "HTTP") 160 101 161 def start_with_callback(self, func, args=None, kwargs=None, 162 server_class = _missing, serverClass = None): 163 """Start, then callback the given func in a new thread.""" 164 165 if args is None: 166 args = () 167 if kwargs is None: 168 kwargs = {} 169 args = (func,) + args 170 171 def _callback(func, *args, **kwargs): 172 self.wait() 173 func(*args, **kwargs) 174 t = threading.Thread(target=_callback, args=args, kwargs=kwargs) 175 t.setName("CPServer Callback " + t.getName()) 176 t.start() 177 178 self.start(server_class = server_class) 102 def restart(self): 103 """Restart the HTTP server.""" 104 self.stop() 105 self.interrupt = None 106 self.start() 179 107 180 108 trunk/cherrypy/_cpwsgi.py
r1090 r1092 66 66 env = environ.get 67 67 clientAddr = (env('REMOTE_ADDR', ''), int(env('REMOTE_PORT', -1))) 68 request = cherrypy. server.request(clientAddr, env('REMOTE_ADDR', ''),68 request = cherrypy.engine.request(clientAddr, env('REMOTE_ADDR', ''), 69 69 environ['wsgi.url_scheme']) 70 70 request.login = (env('LOGON_USER') or env('REMOTE_USER') or None) trunk/cherrypy/lib/covercp.py
r856 r1092 351 351 }) 352 352 cherrypy.server.start() 353 cherrypy.engine.start() 353 354 354 355 if __name__ == "__main__": trunk/cherrypy/lib/profiler.py
r882 r1092 137 137 }) 138 138 cherrypy.server.start() 139 cherrypy.engine.start() 139 140 140 141 trunk/cherrypy/test/benchmark.py
r1082 r1092 269 269 started = False 270 270 def startup(req=None): 271 """Start the CherryPy app server in 'serverless' mode(for WSGI)."""271 """Start the CherryPy app engine with no server (for WSGI).""" 272 272 global started 273 273 if not started: 274 274 started = True 275 cherrypy. server.start(init_only=True, server_class=None)275 cherrypy.engine.start(blocking=False) 276 276 return 0 # apache.OK 277 277 … … 292 292 global AB_PATH 293 293 AB_PATH = ab_opt 294 cherrypy. server.start(init_only=True, server_class=None)294 cherrypy.engine.start(blocking=False) 295 295 296 296 import modpython_gateway … … 384 384 cherrypy.server.response_class = NullResponse 385 385 386 cherrypy.server.start() 386 387 # This will block 387 cherrypy. server.start_with_callback(run)388 cherrypy.engine.start_with_callback(run) trunk/cherrypy/test/helper.py
r1082 r1092 99 99 """ 100 100 setConfig(conf) 101 cherrypy.server.start _with_callback(_run_test_suite_thread,102 args = (moduleNames, conf),103 server_class = server)101 cherrypy.server.start(server) 102 cherrypy.engine.start_with_callback(_run_test_suite_thread, 103 args=(moduleNames, conf)) 104 104 105 105 def _run_test_suite_thread(moduleNames, conf): … … 126 126 setConfig(conf) 127 127 try: 128 cherrypy.server.start_with_callback(_test_main_thread, *args, **kwargs) 128 cherrypy.server.start() 129 cherrypy.engine.start_with_callback(_test_main_thread, *args, **kwargs) 129 130 except KeyboardInterrupt: 130 131 cherrypy.server.stop() 132 cherrypy.engine.stop() 131 133 132 134 def _test_main_thread(): trunk/cherrypy/test/modpy.py
r1036 r1092 86 86 }) 87 87 m.setup_server() 88 cherrypy. server.start(init_only=True, server_class=None, server=None)88 cherrypy.engine.start(blocking=False) 89 89 from mod_python import apache 90 90 return apache.OK trunk/cherrypy/test/test_noserver.py
r943 r1092 28 28 29 29 cherrypy.config.update({"server.environment": "production"}) 30 cherrypy. server.start(server_class = None)30 cherrypy.engine.start() 31 31 trunk/cherrypy/test/test_session_concurrency.py
r941 r1092 77 77 78 78 # Start server 79 thread.start_new_thread(cherrypy.server.start, ()) 79 cherrypy.server.start() 80 thread.start_new_thread(cherrypy.engine.start, ()) 80 81 81 82 # Start client … … 108 109 109 110 cherrypy.server.stop() 111 cherrypy.engine.stop() 110 112 111 113 m = max(data_dict.values()) trunk/cherrypy/test/test_states.py
r1023 r1092 17 17 18 18 def restart(self): 19 cherrypy. server.restart()19 cherrypy.engine.restart() 20 20 return "app was restarted succesfully" 21 21 restart.exposed = True … … 56 56 def test_0_NormalStateFlow(self): 57 57 if not self.server_class: 58 # Without having called "cherrypy. server.start()", we should58 # Without having called "cherrypy.engine.start()", we should 59 59 # get a NotReady error 60 60 self.assertRaises(cherrypy.NotReady, self.getPage, "/") … … 66 66 67 67 # Test server start 68 cherrypy.server.start(True, self.server_class) 69 self.assertEqual(cherrypy.server.state, 1) 68 cherrypy.server.start(self.server_class) 69 cherrypy.engine.start(blocking=False) 70 self.assertEqual(cherrypy.engine.state, 1) 70 71 71 72 if self.server_class: … … 83 84 self.assertEqual(len(db_connection.threads), 1) 84 85 85 # Test serverstop86 cherrypy. server.stop()87 self.assertEqual(cherrypy. server.state, 0)88 89 # Verify that the on_stop_ serverfunction was called86 # Test engine stop 87 cherrypy.engine.stop() 88 self.assertEqual(cherrypy.engine.state, 0) 89 90 # Verify that the on_stop_engine function was called 90 91 self.assertEqual(db_connection.running, False) 91 92 self.assertEqual(len(db_connection.threads), 0) … … 101 102 self.getPage("/") 102 103 self.assertBody("Hello World") 103 cherrypy.server.stop() 104 cherrypy.server.start_with_callback(stoptest, server_class=self.server_class) 105 self.assertEqual(cherrypy.server.state, 0) 104 cherrypy.engine.stop() 105 cherrypy.engine.start_with_callback(stoptest) 106 self.assertEqual(cherrypy.engine.state, 0) 107 cherrypy.server.stop() 106 108 107 109 def test_1_Restart(self): 108 cherrypy.server.start(True, self.server_class) 110 cherrypy.server.start(self.server_class) 111 cherrypy.engine.start(blocking=False) 109 112 110 113 # The db_connection should be running now … … 117 120 118 121 # Test server restart from this thread 119 cherrypy. server.restart()120 self.assertEqual(cherrypy. server.state, 1)122 cherrypy.engine.restart() 123 self.assertEqual(cherrypy.engine.state, 1) 121 124 self.getPage("/") 122 125 self.assertBody("Hello World") … … 127 130 # Test server restart from inside a page handler 128 131 self.getPage("/restart") 129 self.assertEqual(cherrypy. server.state, 1)132 self.assertEqual(cherrypy.engine.state, 1) 130 133 self.assertBody("app was restarted succesfully") 131 134 self.assertEqual(db_connection.running, True) … … 135 138 self.assertEqual(len(db_connection.threads), 0) 136 139 140 cherrypy.engine.stop() 141 self.assertEqual(cherrypy.engine.state, 0) 142 self.assertEqual(db_connection.running, False) 143 self.assertEqual(len(db_connection.threads), 0) 137 144 cherrypy.server.stop() 138 self.assertEqual(cherrypy.server.state, 0)139 self.assertEqual(db_connection.running, False)140 self.assertEqual(len(db_connection.threads), 0)141 145 142 146 def test_2_KeyboardInterrupt(self): … … 150 154 151 155 # We must start the server in this, the main thread 152 cherrypy.server.start( False,self.server_class)156 cherrypy.server.start(self.server_class) 153 157 # Time passes... 154 self.assertEqual(cherrypy.server.state, 0)155 158 self.assertEqual(db_connection.running, False) 156 159 self.assertEqual(len(db_connection.threads), 0) … … 166 169 threading.Thread(target=interrupt).start() 167 170 168 cherrypy.server.start( False,self.server_class)171 cherrypy.server.start(self.server_class) 169 172 # Time passes... 170 self.assertEqual(cherrypy.server.state, 0)171 173 self.assertEqual(db_connection.running, False) 172 174 self.assertEqual(len(db_connection.threads), 0) … … 182 184 global db_connection 183 185 db_connection = Dependency() 184 cherrypy. server.on_start_server_list.append(db_connection.start)185 cherrypy. server.on_stop_server_list.append(db_connection.stop)186 cherrypy. server.on_start_thread_list.append(db_connection.startthread)187 cherrypy. server.on_stop_thread_list.append(db_connection.stopthread)186 cherrypy.engine.on_start_engine_list.append(db_connection.start) 187 cherrypy.engine.on_stop_engine_list.append(db_connection.stop) 188 cherrypy.engine.on_start_thread_list.append(db_connection.startthread) 189 cherrypy.engine.on_stop_thread_list.append(db_connection.stopthread) 188 190 189 191 helper.CPTestRunner.run(suite) 190 192 finally: 191 193 cherrypy.server.stop() 194 cherrypy.engine.stop() 192 195 193 196 trunk/cherrypy/tutorial/bonus-sqlobject.py
r762 r1092 168 168 cherrypy.root = ContactManager() 169 169 cherrypy.server.start() 170 cherrypy.engine.start() trunk/cherrypy/tutorial/tut01_helloworld.py
r762 r1092 32 32 # Start the CherryPy server. 33 33 cherrypy.server.start() 34 cherrypy.engine.start() 34 35 trunk/cherrypy/tutorial/tut02_expose_methods.py
r762 r1092 25 25 cherrypy.config.update(file = 'tutorial.conf') 26 26 cherrypy.server.start() 27 cherrypy.engine.start() 27 28 trunk/cherrypy/tutorial/tut03_get_and_post.py
r762 r1092 47 47 cherrypy.config.update(file = 'tutorial.conf') 48 48 cherrypy.server.start() 49 cherrypy.engine.start() trunk/cherrypy/tutorial/tut04_complex_site.py
r762 r1092 88 88 cherrypy.config.update(file = 'tutorial.conf') 89 89 cherrypy.server.start() 90 cherrypy.engine.start() 90 91 trunk/cherrypy/tutorial/tut05_derived_objects.py
r762 r1092 76 76 cherrypy.config.update(file = 'tutorial.conf') 77 77 cherrypy.server.start() 78 cherrypy.engine.start() 78 79 trunk/cherrypy/tutorial/tut06_default_method.py
r762 r1092 57 57 cherrypy.config.update(file = 'tutorial.conf') 58 58 cherrypy.server.start() 59 cherrypy.engine.start() 59 60 trunk/cherrypy/tutorial/tut07_sessions.py
r1078 r1092 34 34 cherrypy.config.update(file = 'tutorial.conf') 35 35 cherrypy.server.start() 36 cherrypy.engine.start() 36 37 trunk/cherrypy/tutorial/tut08_generators_and_yield.py
r762 r1092 39 39 cherrypy.config.update(file = 'tutorial.conf') 40 40 cherrypy.server.start() 41 cherrypy.engine.start() 41 42 trunk/cherrypy/tutorial/tut09_files.py
r1070 r1092 99 99 # Start the CherryPy server. 100 100 cherrypy.server.start() 101 cherrypy.engine.start() trunk/cherrypy/tutorial/tut10_http_errors.py
r856 r1092 76 76 # Start the CherryPy server. 77 77 cherrypy.server.start() 78 cherrypy.engine.start() trunk/cherrypy/tutorial/tutorial.conf
r1078 r1092 3 3 server.thread_pool = 10 4 4 server.environment = "production" 5 # server.show Tracebacks = True6 # server.logToScreen = False5 # server.show_tracebacks = True 6 server.log_to_screen = True

