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

Module pyblosxom

source code

Classes [hide private]
  PyBlosxom
This is the main class for PyBlosxom functionality.
  PyBlosxomWSGIApp
This class is the WSGI application for PyBlosxom.
  EnvDict
Wrapper arround a dict to provide a backwards compatible way to get the form with syntax as:
  Request
This class holds the PyBlosxom request.
  Response
Response class to handle all output related tasks in one place.
Functions [hide private]
 
pyblosxom_app_factory(global_config, **local_config)
App factory for paste.
source code
 
blosxom_handler(request)
This is the default blosxom handler.
source code
dict
blosxom_entry_parser(filename, request)
Open up a *.txt file and read its contents.
source code
list of EntryBase objects
blosxom_file_list_handler(args)
This is the default handler for getting entries.
source code
 
blosxom_process_path_info(args)
Process HTTP PATH_INFO for URI according to path specifications, fill in data dict accordingly.
source code
 
test_installation(request)
This function gets called when someone starts up pyblosxom.cgi from the command line with no REQUEST_METHOD environment variable.
source code
 
command_line_handler(scriptname, argv)
Handles calling PyBlosxom from the command line.
source code
Variables [hide private]
  __revision__ = '$Revision: 1068 $'
  VERSION = '1.4'
  VERSION_DATE = '1.4 7/2/2007'
  VERSION_SPLIT = ('1', '4')
  HELP = 'Syntax: %(script)s [path-opts] [args]\n\nPATH OPTIONS:...
Function Details [hide private]

blosxom_handler(request)

source code 

This is the default blosxom handler.

It calls the renderer callback to get a renderer. If there is no renderer, it uses the blosxom renderer.

It calls the pathinfo callback to process the path_info http variable.

It calls the filelist callback to build a list of entries to display.

It calls the prepare callback to do any additional preparation before rendering the entries.

Then it tells the renderer to render the entries.
Parameters:

blosxom_entry_parser(filename, request)

source code 
Open up a *.txt file and read its contents. The first line becomes the title of the entry. The other lines are the body of the entry.
Parameters:
  • filename (string) - A filename to extract data and metadata from
  • request (Pyblosxom.pyblosxom.Request object) - A standard request object
Returns: dict
A dict containing parsed data and meta data with the particular file (and plugin)

blosxom_file_list_handler(args)

source code 
This is the default handler for getting entries. It takes the request object in and figures out which entries based on the default behavior that we want to show and generates a list of EntryBase subclass objects which it returns.
Parameters:
  • args (object) - dict containing the incoming Request object
Returns: list of EntryBase objects
the content we want to render

blosxom_process_path_info(args)

source code 

Process HTTP PATH_INFO for URI according to path specifications, fill in data dict accordingly.

The paths specification looks like this:
  • /foo.html and /cat/foo.html - file foo.* in / and /cat
  • /cat - category
  • /2002 - category
  • /2002 - year
  • /2002/Feb (or 02) - Year and Month
  • /cat/2002/Feb/31 - year and month day in category.
Parameters:
  • args (object) - dict containing the incoming Request object

test_installation(request)

source code 

This function gets called when someone starts up pyblosxom.cgi from the command line with no REQUEST_METHOD environment variable.

It:
  1. tests properties in their config.py file
  2. verifies they have a datadir and that it exists
  3. initializes all the plugins they have installed
  4. runs "cb_verify_installation"--plugins can print out whether they are installed correctly (i.e. have valid config property settings and can read/write to data files)
  5. exits

The goal is to be as useful and informative to the user as we can be without being overly verbose and confusing.

This is designed to make it much much much easier for a user to verify their PyBlosxom installation is working and also to install new plugins and verify that their configuration is correct.
Parameters:
  • request (object) - the Request object

command_line_handler(scriptname, argv)

source code 
Handles calling PyBlosxom from the command line. This can be called from two different things: pyblosxom.cgi and pyblcmd.
Parameters:
  • scriptname (string) - the name of the script (ex. "pyblcmd")
  • argv (list of strings) - the arguments passed in
Returns:
the exit code

Variables Details [hide private]

HELP

Value:
'''Syntax: %(script)s [path-opts] [args]

PATH OPTIONS:

  -c, --config

     This specifies the location of the config.py file for the blog 
     you want to work with.  If the config.py file is in the current 
...