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

Module Pyblosxom.pyblosxom

This is the main module for PyBlosxom functionality. PyBlosxom's setup and default handlers are defined here.
Classes
EnvDict Wrapper arround a dict to provide a backwards compatible way to get the form with syntax as: request.getHttp()['form'] instead of: request.getForm()
PyBlosxom This is the main class for PyBlosxom functionality.
Request This class holds the PyBlosxom request.
Response Response class to handle all output related tasks in one place.

Function Summary
dict blosxom_entry_parser(filename, request)
Open up a *.txt file and read its contents.
list of EntryBase objects blosxom_file_list_handler(args)
This is the default handler for getting entries.
  blosxom_handler(request)
This is the default blosxom handler.
  blosxom_process_path_info(args)
Process HTTP PATH_INFO for URI according to path specifications, fill in data dict accordingly
  test_installation(request)
This function gets called when someone starts up pyblosxom.cgi from the command line with no REQUEST_METHOD environment variable.

Variable Summary
str VERSION = '1.3.1'
str VERSION_DATE = '1.3.1 2/7/2006'
tuple VERSION_SPLIT = ('1', '3', '1')

Function Details

blosxom_entry_parser(filename, request)

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 - A filename to extract data and metadata from
           (type=string)
request - A standard request object
           (type=Pyblosxom.pyblosxom.Request object)
Returns:
A dict containing parsed data and meta data with the particular file (and plugin)
           (type=dict)

blosxom_file_list_handler(args)

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 - dict containing the incoming Request object
           (type=Pyblosxom.pyblosxom.Request)
Returns:
the content we want to render
           (type=list of EntryBase objects)

blosxom_handler(request)

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:
request - A standard request object
           (type=Pyblosxom.pyblosxom.Request object)

blosxom_process_path_info(args)

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 - year
  • /2002/Feb (or 02) - Year and Month
  • /cat/2002/Feb/31 - year and month day in category.
To simplify checking, four digits directory name is not allowed.
Parameters:
args - dict containing the incoming Request object
           (type=Pyblosxom.pyblosxom.Request)

test_installation(request)

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.

Variable Details

VERSION

Type:
str
Value:
'1.3.1'                                                                

VERSION_DATE

Type:
str
Value:
'1.3.1 2/7/2006'                                                       

VERSION_SPLIT

Type:
tuple
Value:
('1', '3', '1')                                                        

Generated by Epydoc 2.1 on Tue Feb 7 21:43:58 2006 http://epydoc.sf.net