Changeset 1837
- Timestamp:
- 01/12/08 17:35:17
- Files:
-
- trunk/cherrypy/__init__.py (modified) (2 diffs)
- trunk/cherrypy/_cpserver.py (modified) (3 diffs)
- trunk/cherrypy/test/benchmark.py (modified) (1 diff)
- trunk/cherrypy/test/helper.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)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1826 r1837 223 223 224 224 225 def quickstart(root , script_name="", config=None):225 def quickstart(root=None, script_name="", config=None): 226 226 """Mount the given root, start the builtin server (and engine), then block. 227 227 … … 242 242 if config: 243 243 _global_conf_alias.update(config) 244 tree.mount(root, script_name, config) 244 245 if root is not None: 246 tree.mount(root, script_name, config) 245 247 246 248 signal_handler.subscribe() trunk/cherrypy/_cpserver.py
r1824 r1837 2 2 3 3 import socket 4 import warnings 4 5 5 6 import cherrypy … … 19 20 20 21 cherrypy.server.socket_port = 80 21 cherrypy.server.quickstart() 22 23 If you want to use an HTTP server other than the default, create it 24 and pass it to quickstart: 25 26 s = MyCustomWSGIServer(wsgiapp, port=8080) 27 cherrypy.server.quickstart(s) 22 cherrypy.quickstart() 28 23 """ 29 24 … … 66 61 67 62 def quickstart(self, server=None): 68 """Start from defaults. MUST be called from the main thread. 69 70 This function works like CherryPy 2's server.start(). It loads and 71 starts an httpserver based on the given server object (if provided) 72 and attributes of self. 73 """ 74 self.httpserver, self.bind_addr = self.httpserver_from_self(server) 75 self.start() 63 """This does nothing now and will be removed in 3.2.""" 64 warnings.warn('quickstart does nothing now and will be removed in ' 65 '3.2. Call cherrypy.engine.start() instead.', 66 DeprecationWarning) 76 67 77 68 def httpserver_from_self(self, httpserver=None): trunk/cherrypy/test/benchmark.py
r1830 r1837 400 400 cherrypy.server.response_class = NullResponse 401 401 402 cherrypy.server.quickstart()403 402 # This will block 404 403 cherrypy.engine.start_with_callback(run) trunk/cherrypy/test/helper.py
r1830 r1837 185 185 conf = {'server.socket_host': '127.0.0.1'} 186 186 setConfig(conf) 187 cherrypy.server.quickstart()188 187 cherrypy.engine.start_with_callback(_test_main_thread) 189 188 cherrypy.engine.block() trunk/cherrypy/tutorial/tut02_expose_methods.py
r1627 r1837 24 24 if __name__ == '__main__': 25 25 import os.path 26 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 27 cherrypy.server.quickstart() 28 cherrypy.engine.start() 29 cherrypy.engine.block() 26 thisdir = os.path.dirname(__file__) 27 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) 30 28 trunk/cherrypy/tutorial/tut03_get_and_post.py
r1627 r1837 46 46 if __name__ == '__main__': 47 47 import os.path 48 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 49 cherrypy.server.quickstart() 50 cherrypy.engine.start() 51 cherrypy.engine.block() 48 thisdir = os.path.dirname(__file__) 49 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut04_complex_site.py
r1627 r1837 88 88 if __name__ == '__main__': 89 89 import os.path 90 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 91 cherrypy.server.quickstart() 92 cherrypy.engine.start() 93 cherrypy.engine.block() 90 thisdir = os.path.dirname(__file__) 91 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) 94 92 trunk/cherrypy/tutorial/tut05_derived_objects.py
r1627 r1837 75 75 if __name__ == '__main__': 76 76 import os.path 77 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 78 cherrypy.server.quickstart() 79 cherrypy.engine.start() 80 cherrypy.engine.block() 81 77 thisdir = os.path.dirname(__file__) 78 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut06_default_method.py
r1627 r1837 56 56 if __name__ == '__main__': 57 57 import os.path 58 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 59 cherrypy.server.quickstart() 60 cherrypy.engine.start() 61 cherrypy.engine.block() 62 58 thisdir = os.path.dirname(__file__) 59 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut07_sessions.py
r1627 r1837 36 36 if __name__ == '__main__': 37 37 import os.path 38 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 39 cherrypy.server.quickstart() 40 cherrypy.engine.start() 41 cherrypy.engine.block() 42 38 thisdir = os.path.dirname(__file__) 39 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut08_generators_and_yield.py
r1627 r1837 38 38 if __name__ == '__main__': 39 39 import os.path 40 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 41 cherrypy.server.quickstart() 42 cherrypy.engine.start() 43 cherrypy.engine.block() 44 40 thisdir = os.path.dirname(__file__) 41 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut09_files.py
r1627 r1837 96 96 if __name__ == '__main__': 97 97 import os.path 98 # Start the CherryPy server. 99 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 100 cherrypy.server.quickstart() 101 cherrypy.engine.start() 102 cherrypy.engine.block() 98 thisdir = os.path.dirname(__file__) 99 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf')) trunk/cherrypy/tutorial/tut10_http_errors.py
r1627 r1837 73 73 74 74 if __name__ == '__main__': 75 # Start the CherryPy server. 76 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 77 cherrypy.server.quickstart() 78 cherrypy.engine.start() 79 cherrypy.engine.block() 75 import os.path 76 thisdir = os.path.dirname(__file__) 77 cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))

