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

Changeset 1219

Show
Ignore:
Timestamp:
08/05/06 18:05:52
Author:
fumanchu
Message:

Changed server.start to server.quickstart, and server.start_all to server.start.

Files:

Legend:

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

    r1205 r1219  
    2121    """Mount the given app, start the engine and builtin server, then block.""" 
    2222    tree.mount(root, script_name, conf) 
    23     server.start() 
     23    server.quickstart() 
    2424    engine.start() 
    2525 
  • trunk/cherrypy/_cpserver.py

    r1217 r1219  
    1616        self.interrupt = None 
    1717     
    18     def start(self, server=None): 
    19         """Main function. MUST be called from the main thread.""" 
    20         self.interrupt = None 
     18    def quickstart(self, server=None): 
     19        """Main function for quick starts. MUST be called from the main thread. 
     20         
     21        This function works like CherryPy 2's server.start(). It loads and 
     22        starts an httpserver based on the given server object, if any, and 
     23        config entries. 
     24        """ 
    2125        httpserver, bind_addr = self.httpserver_from_config(server) 
    2226        self.httpservers[httpserver] = bind_addr 
    23         self._start_http(httpserver
     27        self.start(
    2428     
    2529    def httpserver_from_config(self, httpserver=None): 
     
    4347            return httpserver, conf('server.socket_file') 
    4448     
    45     def start_all(self): 
     49    def start(self): 
    4650        """Start all registered HTTP servers.""" 
     51        self.interrupt = None 
    4752        for httpserver in self.httpservers: 
    4853            self._start_http(httpserver) 
     
    121126        """Restart the HTTP server.""" 
    122127        self.stop() 
    123         self.interrupt = None 
    124         self.start_all() 
     128        self.start() 
    125129 
    126130 
  • trunk/cherrypy/lib/covercp.py

    r1135 r1219  
    350350     
    351351    import cherrypy 
    352     cherrypy.tree.mount(CoverStats()) 
    353352    cherrypy.config.update({'server.socket_port': port, 
    354353                            'server.thread_pool': 10, 
    355354                            'environment': "production", 
    356355                            }) 
    357     cherrypy.server.start() 
    358     cherrypy.engine.start() 
     356    cherrypy.quickstart(CoverStats()) 
    359357 
    360358if __name__ == "__main__": 
  • trunk/cherrypy/lib/profiler.py

    r1194 r1219  
    171171def serve(path=None, port=8080): 
    172172    import cherrypy 
    173     cherrypy.tree.mount(Profiler(path)) 
    174173    cherrypy.config.update({'server.socket_port': int(port), 
    175174                            'server.thread_pool': 10, 
    176175                            'environment': "production", 
    177176                            }) 
    178     cherrypy.server.start() 
    179     cherrypy.engine.start() 
     177    cherrypy.quickstart(Profiler(path)) 
    180178 
    181179 
  • trunk/cherrypy/test/benchmark.py

    r1191 r1219  
    402402            cherrypy.server.response_class = NullResponse 
    403403         
    404         cherrypy.server.start() 
     404        cherrypy.server.quickstart() 
    405405        # This will block 
    406406        cherrypy.engine.start_with_callback(run) 
  • trunk/cherrypy/test/helper.py

    r1217 r1219  
    9898    cherrypy.config.reset() 
    9999    setConfig(conf) 
    100     cherrypy.server.start(server) 
     100    cherrypy.server.quickstart(server) 
    101101    cherrypy.engine.start_with_callback(_run_test_suite_thread, 
    102102                                        args=(moduleNames, conf)) 
     
    148148    setConfig(conf) 
    149149    try: 
    150         cherrypy.server.start() 
     150        cherrypy.server.quickstart() 
    151151        cherrypy.engine.start_with_callback(_test_main_thread) 
    152152    except KeyboardInterrupt: 
  • trunk/cherrypy/test/test_session_concurrency.py

    r1096 r1219  
    8080 
    8181# Start server 
    82 cherrypy.server.start() 
     82cherrypy.server.quickstart() 
    8383thread.start_new_thread(cherrypy.engine.start, ()) 
    8484 
  • trunk/cherrypy/test/test_states.py

    r1217 r1219  
    6868         
    6969        # Test server start 
    70         cherrypy.server.start(self.server_class) 
     70        cherrypy.server.quickstart(self.server_class) 
    7171        cherrypy.engine.start(blocking=False) 
    7272        self.assertEqual(cherrypy.engine.state, 1) 
     
    111111     
    112112    def test_1_Restart(self): 
    113         cherrypy.server.start(self.server_class
     113        cherrypy.server.start(
    114114        cherrypy.engine.start(blocking=False) 
    115115         
     
    153153            # We must start the server in this, the main thread 
    154154            cherrypy.engine.start(blocking=False) 
    155             cherrypy.server.start(self.server_class
    156             cherrypy.server.httpservers.values()[0].interrupt = KeyboardInterrupt 
     155            cherrypy.server.start(
     156            cherrypy.server.httpservers.keys()[0].interrupt = KeyboardInterrupt 
    157157            while cherrypy.engine.state != 0: 
    158158                time.sleep(0.1) 
     
    167167            # thread will just die without writing a response. 
    168168            cherrypy.engine.start(blocking=False) 
    169             cherrypy.server.start(self.server_class
     169            cherrypy.server.start(
    170170             
    171171            from httplib import BadStatusLine 
  • trunk/cherrypy/test/test_states_demo.py

    r1206 r1219  
    2828                            }) 
    2929    cherrypy.quickstart(Root()) 
    30   
     30     
  • trunk/cherrypy/tutorial/bonus-sqlobject.py

    r1096 r1219  
    166166print "If you're running this application for the first time, please go to http://localhost:8080/reset once in order to create the database!" 
    167167 
    168 cherrypy.tree.mount(ContactManager()) 
    169 cherrypy.server.start() 
    170 cherrypy.engine.start() 
     168cherrypy.quickstart(ContactManager()) 
  • trunk/cherrypy/tutorial/tut02_expose_methods.py

    r1110 r1219  
    2525    import os.path 
    2626    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    27     cherrypy.server.start() 
     27    cherrypy.server.quickstart() 
    2828    cherrypy.engine.start() 
    2929 
  • trunk/cherrypy/tutorial/tut03_get_and_post.py

    r1110 r1219  
    4747    import os.path 
    4848    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    49     cherrypy.server.start() 
     49    cherrypy.server.quickstart() 
    5050    cherrypy.engine.start() 
  • trunk/cherrypy/tutorial/tut04_complex_site.py

    r1110 r1219  
    8989    import os.path 
    9090    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    91     cherrypy.server.start() 
     91    cherrypy.server.quickstart() 
    9292    cherrypy.engine.start() 
    9393 
  • trunk/cherrypy/tutorial/tut05_derived_objects.py

    r1110 r1219  
    7676    import os.path 
    7777    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    78     cherrypy.server.start() 
     78    cherrypy.server.quickstart() 
    7979    cherrypy.engine.start() 
    8080 
  • trunk/cherrypy/tutorial/tut06_default_method.py

    r1110 r1219  
    5757    import os.path 
    5858    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    59     cherrypy.server.start() 
     59    cherrypy.server.quickstart() 
    6060    cherrypy.engine.start() 
    6161 
  • trunk/cherrypy/tutorial/tut07_sessions.py

    r1110 r1219  
    3737    import os.path 
    3838    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    39     cherrypy.server.start() 
     39    cherrypy.server.quickstart() 
    4040    cherrypy.engine.start() 
    4141 
  • trunk/cherrypy/tutorial/tut08_generators_and_yield.py

    r1110 r1219  
    3939    import os.path 
    4040    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    41     cherrypy.server.start() 
     41    cherrypy.server.quickstart() 
    4242    cherrypy.engine.start() 
    4343 
  • trunk/cherrypy/tutorial/tut09_files.py

    r1110 r1219  
    9898    # Start the CherryPy server. 
    9999    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    100     cherrypy.server.start() 
     100    cherrypy.server.quickstart() 
    101101    cherrypy.engine.start() 
  • trunk/cherrypy/tutorial/tut10_http_errors.py

    r1096 r1219  
    7575    # Start the CherryPy server. 
    7676    cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 
    77     cherrypy.server.start() 
     77    cherrypy.server.quickstart() 
    7878    cherrypy.engine.start() 

Hosted by WebFaction

Log in as guest/cpguest to create tickets