Package svnmailer :: Package notifier :: Module _base :: Class BaseNotifier
[show private | hide private]
[frames | no frames]

Class BaseNotifier

object --+
         |
        BaseNotifier

Known Subclasses:
TextNotifier

Base class for notifiers

Custom notifiers must implement this interface (that is just the run method, however).

Additionally it contains some useful utility methods, which can be used.
Method Summary
  __init__(self, settings)
Initialization
tuple of svnmailer.util.TempFile dumpContent(self, change, enc)
Dump the two revisions of a particular change
str getAuthor(self)
Returns the author of the revision
unicode getContentDiffAction(self, change)
Returns the content diff action for a particular change
str getContentDiffUrl(self, config, change)
Returns the content diff url for a particular change
svnmailer.differ.* getDiffer(self)
Returns the initialized differ
tuple getDiffTokens(self, config)
Returns valid diff tokens and tests
str getLog(self)
Returns the log entry of the revision
unicode getPropertyDiffAction(self, values)
Returns the property diff action for a particular change
svnmailer.util.TempFile getTempFile(self)
Returns an open temporary file container object
int getTime(self)
Returns the time of the revision in seconds since epoch
str getUrl(self, config)
Returns the revision URL
bool isBinaryProperty(self, values)
Returns if the supplied property seems to be binary
bool isOneLineProperty(self, name, value)
Returns if the supplied property value takes just one line
  run(self, groupset)
Run the notifier
    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
svnmailer.settings.Settings _settings: The settings to use

Class Variable Summary
tuple _diffable_tests: Map generate_diffs list entrys to change methods
unicode ADD: "add" token
unicode COPY: "copy" token
unicode DELETE: "delete" token
unicode MODIFY: "modify" token
unicode NONE: "none" token
unicode PROPCHANGE: "propchange" token

Method Details

__init__(self, settings)
(Constructor)

Initialization
Overrides:
__builtin__.object.__init__

dumpContent(self, change, enc='utf-8')

Dump the two revisions of a particular change

(This dumps the files, not the properties)
Parameters:
change - The particular change to process
           (type=

svnmailer.subversion._PathChangeDescriptor)

enc - The file data encoding (The data will be recoded to UTF-8; but by default it isn't recoded, because utf-8 is assumed)
           (type=str)
Returns:
Two file container objects
           (type=tuple of svnmailer.util.TempFile)

getAuthor(self)

Returns the author of the revision
Returns:
The author or None if there's no author
           (type=str)

getContentDiffAction(self, change)

Returns the content diff action for a particular change
Parameters:
change - The particular change to process
           (type=

svnmailer.subversion._PathChangeDescriptor)

Returns:
The diff token or None if there nothing
           (type=unicode)

getContentDiffUrl(self, config, change)

Returns the content diff url for a particular change
Parameters:
config - group config
           (type=

svnmailer.settings._GroupSettingsContainer)

change - The particular change to process
           (type=

svnmailer.subversion._PathChangeDescriptor)

Returns:
The URL or None if there's no base URL configured
           (type=str)

To Do: make the URL patterns configurable?

getDiffer(self)

Returns the initialized differ
Returns:
The differ type
           (type=svnmailer.differ.*)

getDiffTokens(self, config)

Returns valid diff tokens and tests
Parameters:
config - group config
           (type=

svnmailer.settings._GroupSettingsContainer)

Returns:
The diff tokens and diffable tests The first element of the tuple contains a list of diff tokens, the second element the diff tests
           (type=tuple)

getLog(self)

Returns the log entry of the revision
Returns:
The log entry
           (type=str)

getPropertyDiffAction(self, values)

Returns the property diff action for a particular change
Parameters:
values - The two values of the property
           (type=tuple)
Returns:
The diff token
           (type=unicode)

getTempFile(self)

Returns an open temporary file container object
Returns:
The filename and an descriptor
           (type=svnmailer.util.TempFile)

getTime(self)

Returns the time of the revision in seconds since epoch
Returns:
The time
           (type=int)

getUrl(self, config)

Returns the revision URL
Returns:
The URL or None
           (type=str)

isBinaryProperty(self, values)

Returns if the supplied property seems to be binary

Note that is a very rudimentary check, just to not pollute diff output with garbage
Parameters:
values - The value tuple
           (type=tuple)
Returns:
binary property?
           (type=bool)

isOneLineProperty(self, name, value)

Returns if the supplied property value takes just one line
Parameters:
name - Property name
           (type=str)
value - The property value
           (type=str)
Returns:
one line property?
           (type=bool)

run(self, groupset)

Run the notifier
Parameters:
groupset - The groupset to process
           (type=list)

Instance Variable Details

_settings

The settings to use
Type:
svnmailer.settings.Settings

Class Variable Details

_diffable_tests

Map generate_diffs list entrys to change methods
Type:
tuple
Value:
((u'add', <function <lambda> at 0x4034002c>),
 (u'delete', <function <lambda> at 0x40340064>),
 (u'copy', <function <lambda> at 0x4034009c>),
 (u'modify', <function <lambda> at 0x403400d4>),
 (u'propchange', <function <lambda> at 0x4034010c>),
 (u'none', <function <lambda> at 0x40340144>))                         

ADD

"add" token
Type:
unicode
Value:
u'add'                                                                 

COPY

"copy" token
Type:
unicode
Value:
u'copy'                                                                

DELETE

"delete" token
Type:
unicode
Value:
u'delete'                                                              

MODIFY

"modify" token
Type:
unicode
Value:
u'modify'                                                              

NONE

"none" token
Type:
unicode
Value:
u'none'                                                                

PROPCHANGE

"propchange" token
Type:
unicode
Value:
u'propchange'                                                          

Generated by Epydoc 2.0 on Mon Feb 14 16:49:18 2005 http://epydoc.sf.net