Package Pyblosxom :: Module tools :: Class Replacer
[show private | hide private]
[frames | no frames]

Class Replacer


Class for replacing variables in a template

This class is a utility class used to provide a bound method to the re.sub() function. Gotten from OPAGCGI.
Method Summary
  __init__(self, request, encoding, var_dict)
It's only duty is to populate itself with the replacement dictionary passed.
string replace(self, matchobj)
The replacement method.

Method Details

__init__(self, request, encoding, var_dict)
(Constructor)

It's only duty is to populate itself with the replacement dictionary passed.
Parameters:
request - the Request object
           (type=Request)
encoding - the encoding to use
           (type=string)
var_dict - The dict for variable substitution
           (type=dict)

replace(self, matchobj)

The replacement method.

This is passed a match object by re.sub(), which it uses to index the replacement dictionary and find the replacement string.
Parameters:
matchobj - A re object containing substitutions
           (type=re object)
Returns:
Substitutions
           (type=string)

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