Package turbogears :: Module startup

Module startup

source code

Things to do when the TurboGears server is started.

Functions
 
reloader_thread(freq)
Monkeypatch for the reloader provided by CherryPy.
source code
 
start_bonjour(package=None)
Register the TurboGears server with the Bonjour framework.
source code
 
stop_bonjour()
Stop the bonjour publishing daemon if it is running.
source code
 
startTurboGears()
Handles TurboGears tasks when the CherryPy server starts.
source code
 
stopTurboGears()
Handles TurboGears tasks when the CherryPy server stops.
source code
 
start_server(root) source code
Variables
  call_on_startup = []
  call_on_shutdown = []
  webpath = ''
Function Details

reloader_thread(freq)

source code 

Monkeypatch for the reloader provided by CherryPy.

This reloader is designed to reload a single package. This is more efficient and, more important, compatible with zipped libraries that may not provide access to the individual files.

start_bonjour(package=None)

source code 

Register the TurboGears server with the Bonjour framework.

Currently only Unix-like systems are supported where either the 'avahi' daemon (Linux etc.) is available or the 'dns-sd' program (Mac OS X).

startTurboGears()

source code 
Handles TurboGears tasks when the CherryPy server starts.

This performs the following initialization tasks (in given order):

* Turns off CherryPy's logging filter when in development mode
* If logging is not already set up, turns on old-style stdlib logging.
* Adds a static filter for TurboGears's static files (URL '/tg_static').
* Adds a static filter for TurboGears's JavaScript files (URL '/tg_js').
* Loads the template engines and the base templates.
* Adds the CherryPy request filters to the root controller.
* Adds the decoding filter to the root URL ('/') if enabled in the
  configuration.
* Registers the server with the Bonjour framework, if available.
* Calls 'turbogears.database.bind_metadata' when using SQLAlchemy.
* Loads all turbogears.extensions entry points and calls their
  'start_extension' method.
* Calls the callables registered in 'turbogears.call_on_startup'.
* Starts the TurboGears scheduler.

stopTurboGears()

source code 

Handles TurboGears tasks when the CherryPy server stops.

Ends all open database transactions, shuts down all extensions, calls user provided shutdown functions and stops the scheduler.