Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1837

Show
Ignore:
Timestamp:
01/12/08 17:35:17
Author:
fumanchu
Message:

Fix for #756 (Deprecate server.quickstart):

  • server.quickstart now does nothing but raise a warning.
  • Made 'root' argument to cherrypy.quickstart optional (to make tutorials easier, but it applies broadly).
  • Removed all calls to server.quickstart.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/__init__.py

    r1826 r1837  
    223223 
    224224 
    225 def quickstart(root, script_name="", config=None): 
     225def quickstart(root=None, script_name="", config=None): 
    226226    """Mount the given root, start the builtin server (and engine), then block. 
    227227     
     
    242242    if config: 
    243243        _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) 
    245247     
    246248    signal_handler.subscribe() 
  • trunk/cherrypy/_cpserver.py

    r1824 r1837  
    22 
    33import socket 
     4import warnings 
    45 
    56import cherrypy 
     
    1920     
    2021        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() 
    2823    """ 
    2924     
     
    6661     
    6762    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) 
    7667     
    7768    def httpserver_from_self(self, httpserver=None): 
  • trunk/cherrypy/test/benchmark.py

    r1830 r1837  
    400400            cherrypy.server.response_class = NullResponse 
    401401         
    402         cherrypy.server.quickstart() 
    403402        # This will block 
    404403        cherrypy.engine.start_with_callback(run) 
  • trunk/cherrypy/test/helper.py

    r1830 r1837  
    185185        conf = {'server.socket_host': '127.0.0.1'} 
    186186    setConfig(conf) 
    187     cherrypy.server.quickstart() 
    188187    cherrypy.engine.start_with_callback(_test_main_thread) 
    189188    cherrypy.engine.block() 
  • trunk/cherrypy/tutorial/tut02_expose_methods.py

    r1627 r1837  
    2424if __name__ == '__main__': 
    2525    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')) 
    3028 
  • trunk/cherrypy/tutorial/tut03_get_and_post.py

    r1627 r1837  
    4646if __name__ == '__main__': 
    4747    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  
    8888if __name__ == '__main__': 
    8989    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')) 
    9492 
  • trunk/cherrypy/tutorial/tut05_derived_objects.py

    r1627 r1837  
    7575if __name__ == '__main__': 
    7676    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  
    5656if __name__ == '__main__': 
    5757    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  
    3636if __name__ == '__main__': 
    3737    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  
    3838if __name__ == '__main__': 
    3939    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  
    9696if __name__ == '__main__': 
    9797    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  
    7373 
    7474if __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')) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets