Package svnmailer :: Package browser :: Module _base :: Class BaseGenerator
[show private | hide private]
[frames | no frames]

Class BaseGenerator

object --+
         |
        BaseGenerator

Known Subclasses:
Generator, Generator, Generator, Generator, Generator, Generator

Abstract base URL generator

Actual generators need to implement the _createTemplate method.


Method Summary
  __init__(self, base_url, config, **kwargs)
Initialization
ParsedUrl _createParsedUrl(self, url)
Returns a ParsedUrl instance
  _createTemplate(self, base_url, config)
Returns a Template instance
dict _quoteDict(self, toquote)
URL-escapes the values of the supplied dict
str getContentDiffUrl(self, change)
Returns the content diff URL for a particular change
str getRevisionUrl(self)
Returns the revision summary URL
bool hasTemplates(self)
Returns whether there are any templates stored
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Instance Variable Summary
dict _subst: The substitution record

Class Variable Summary
str _QUERY_ENCODING: The character encoding to use for url parameters
    Format Names
unicode _N_BASE_PATH: The format name of the previous path of the changed file
unicode _N_BASE_REVISION: The base revision format name
unicode _N_PATH: The format name of the changed path
unicode _N_REVISION: The revision format name
    Format Strings
unicode _BASE_PATH: The previous path of the changed file
unicode _BASE_REVISION: The base revision format string
unicode _PATH: The changed path (without a leading slash)
unicode _REVISION: The revision format string

Method Details

__init__(self, base_url, config, **kwargs)
(Constructor)

Initialization
Parameters:
base_url - The base URL
           (type=unicode)
config - The group configuration
           (type=svnmailer.settings._base.GroupSettingsContainer)
Raises:
svnmailer.browser.Error - The configured URL is invalid
AttributeError - see _createTemplate
NotImplementedError - see _createTemplate
Overrides:
__builtin__.object.__init__

_createParsedUrl(self, url)

Returns a ParsedUrl instance
Parameters:
url - The url to parse
           (type=str, unicode or ParsedUrl)
Returns:
The new ParsedUrl instance
           (type=ParsedUrl)

_createTemplate(self, base_url, config)

Returns a Template instance
Parameters:
base_url - The base URL
           (type=unicode)
config - The complete group configuration
           (type=svnmailer.settings._base.GroupSettingsContainer)
Raises:
NotImplementedError - The method was not overridden

_quoteDict(self, toquote)

URL-escapes the values of the supplied dict

All values are first UTF-8 encoded and then URL escaped. If you need something else, feel free to override this method in your particular generator. If you just need another encoding, override the _QUERY_ENCODING class variable. But be prepared to get an UnicodeError if an entity is not mappable to your different encoding.

Parameters:
toquote - The dict to process
           (type=dict)
Returns:
The quoted dict
           (type=dict)

getContentDiffUrl(self, change)

Returns the content diff URL for a particular change
Parameters:
change - The change to process
           (type=svnmailer.subversion.VersionedPathDescriptor)
Returns:
The URL or None if no appropriate template could be found
           (type=str)

getRevisionUrl(self)

Returns the revision summary URL
Returns:
The URL or None if not appropriate template could be found
           (type=str)

hasTemplates(self)

Returns whether there are any templates stored
Returns:
Are there any templates?
           (type=bool)

Instance Variable Details

_subst

The substitution record
Type:
dict

Class Variable Details

_BASE_PATH

The previous path of the changed file
Type:
unicode
Value:
u'%(base_path)s'                                                       

_BASE_REVISION

The base revision format string
Type:
unicode
Value:
u'%(base_revision)s'                                                   

_N_BASE_PATH

The format name of the previous path of the changed file
Type:
unicode
Value:
u'base_path'                                                           

_N_BASE_REVISION

The base revision format name
Type:
unicode
Value:
u'base_revision'                                                       

_N_PATH

The format name of the changed path
Type:
unicode
Value:
u'path'                                                                

_N_REVISION

The revision format name
Type:
unicode
Value:
u'revision'                                                            

_PATH

The changed path (without a leading slash)
Type:
unicode
Value:
u'%(path)s'                                                            

_QUERY_ENCODING

The character encoding to use for url parameters
Type:
str
Value:
'utf-8'                                                                

_REVISION

The revision format string
Type:
unicode
Value:
u'%(revision)s'                                                        

Generated by Epydoc 2.0 on Sun Sep 25 20:49:05 2005 http://epydoc.sf.net