Package Pyblosxom :: Module pyblosxom :: Class PyBlosxom
[hide private]
[frames] | no frames]

Class PyBlosxom

source code

This is the main class for PyBlosxom functionality. It handles initialization, defines default behavior, and also pushes the request through all the steps until the output is rendered and we're complete.

Instance Methods [hide private]
 
__init__(self, config, environ, data=None)
Sets configuration and environment.
source code
 
initialize(self)
The initialize step further initializes the Request by setting additional information in the _data dict, registering plugins, and entryparsers.
source code
 
cleanup(self)
This cleans up PyBlosxom after a run.
source code
Request
getRequest(self)
Returns the Request object for this PyBlosxom instance.
source code
Response
getResponse(self)
Returns the Response object which handles all output related functionality for this PyBlosxom instance.
source code
 
run(self, static=False)
This is the main loop for PyBlosxom.
source code
varies
runCallback(self, callback='help')
This method executes the start callback (initializing plugins), executes the requested callback, and then executes the end callback.
source code
 
runRenderOne(self, url, headers)
Renders a single page from the blog.
source code
 
runStaticRenderer(self, incremental=0)
This will go through all possible things in the blog and statically render everything to the "static_dir" specified in the config file.
source code
 
testInstallation(self)
Goes through and runs some basic tests of the installation to make sure things are working.
source code
Method Details [hide private]

__init__(self, config, environ, data=None)
(Constructor)

source code 
Sets configuration and environment. Creates the Request object.
Parameters:
  • config (dict) - A dict containing the configuration variables.
  • environ (dict) - A dict containing the environment variables.
  • data (dict) - A dict containing data variables.

cleanup(self)

source code 

This cleans up PyBlosxom after a run. Mostly it calls tools.cleanup which in turn shuts down the logging.

This should be called when Pyblosxom has done all its work right before exiting.

getRequest(self)

source code 
Returns the Request object for this PyBlosxom instance.
Returns: Request
the request object

getResponse(self)

source code 
Returns the Response object which handles all output related functionality for this PyBlosxom instance.
Returns: Response
the reponse object

See Also: Response

run(self, static=False)

source code 
This is the main loop for PyBlosxom. This method will run the handle callback to allow registered handlers to handle the request. If nothing handles the request, then we use the default_blosxom_handler.
Parameters:
  • static (boolean) - True if we should execute in "static rendering mode" and False otherwise

runCallback(self, callback='help')

source code 
This method executes the start callback (initializing plugins), executes the requested callback, and then executes the end callback. This is useful for scripts outside of PyBlosxom that need to do things inside of the PyBlosxom framework.
Parameters:
  • callback (string) - the callback to execute
Returns: varies
the result of calling the callback

runRenderOne(self, url, headers)

source code 
Renders a single page from the blog.
Parameters:
  • url (string) - the url to render--this has to be relative to PyBlosxom
  • headers (int) - 1 if you want the headers rendered and 0 if not.

runStaticRenderer(self, incremental=0)

source code 

This will go through all possible things in the blog and statically render everything to the "static_dir" specified in the config file.

This figures out all the possible path_info settings and calls self.run() a bazillion times saving each file.
Parameters:
  • incremental (boolean) - whether (1) or not (0) to incrementally render the pages. if we're incrementally rendering pages, then we render only the ones that have changed.

testInstallation(self)

source code 

Goes through and runs some basic tests of the installation to make sure things are working.

FIXME - This could probably use some work. Maybe make this like MoinMoin's SystemInfo page?