Package svnmailer :: Package notifier :: Module cia_xmlrpc :: Class CIAXMLRPCNotifier
[show private | hide private]
[frames | no frames]

Class CIAXMLRPCNotifier

  object --+    
           |    
BaseNotifier --+
               |
              CIAXMLRPCNotifier


The CIA XML-RPC Notifier class
Method Summary
  __init__(self, config, groupset)
Initialization
  _addBody(self, doc)
Adds the actual commit info to the message
  _addGenerator(self, doc)
Adds the generator info to the message
  _addSource(self, doc)
Adds the source info to the message
  _addTextElements(self, parent, *elems)
Add multiple text elements
  _addTimeStamp(self, doc)
Adds revision timestamp to the message
  _getAuthorName(self)
Returns the name of the author
unicode _getDiffLineCount(self)
Returns the number of changed lines
unicode _getFileAction(self, change)
Returns the action applied to the changed file
unicode _getFileType(self, change)
Returns the type of the modified file
unicode _getFileUri(self, change)
Returns an URL associated with the changed file
int _getTagCount(self, diff_out)
Returns the number of changed lines for a diff
  _getTextElement(self, doc, name, value, attr)
Returns a new element containing text to the message
unicode _stripPath(self, path)
Returns the stripped path of a change
DOM object composeCIAXMLMessage(self)
Composes the XML message to send
  deliverRPCMessage(self, doc)
Delivers the supplied message via XML-RPC
  run(self)
Submits notification via XMLRPC to a CIA server
    Inherited from BaseNotifier
str _getContentEncoding(self, path, revision)
Returns the encoding for the specified path and revision
tuple dumpContent(self, change, enc, default)
Dump the two revisions of a particular change
str getAuthor(self)
Returns the author of the revision
  getBrowserGenerator(self, config)
Returns the browser generator if any
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
str getContentEncodingProperty(self, path, revision)
Returns the content encoding property for a path/rev
tuple getContentEncodings(self, change, default)
Returns the encodings of the change content (base and current rev)
svnmailer.differ.* getDiffer(self, command, tags)
Returns the initialized differ
tuple getDiffTokens(self, config)
Returns valid diff tokens and tests
str getEncodingFromMimeType(self, path, revision)
Returns the encoding extracted from svn:mime-type
str getLog(self)
Returns the log entry of the revision
unicode getPropertyDiffAction(self, values)
Returns the property diff action for a particular change
unicode or str getTempDir(self)
Returns the temporary directory
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
bool isUTF8Property(self, name)
Returns if the supplied property name represents an UTF-8 property
    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
list changeset: The changeset to process
svnmailer.settings._base.GroupSettingsContainer config: The current group configuration
svnmailer.differ.* differ: The differ object
    Inherited from BaseNotifier
svnmailer.main.GroupSet _groupset: The groupset to process
dict _penc_cache: The (path, rev) -> property encoding cache
svnmailer.settings._base.BaseSettings _settings: The settings to use

Class Variable Summary
list __implements__ = [<class 'svnmailer.notifier._base.BaseN...
    Inherited from BaseNotifier
tuple _diffable_tests: Maps generate_diffs list entrys to change methods
unicode ADD: "add" token
unicode COPY: "copy" token
unicode DELETE: "delete" token
str ENC_CONFIG: Magic value, meaning that the content encoding should be retrieved from the config
str ENC_DEFAULT: Magic value to determine if the default encoding should be displayed
str ENC_PROPERTY: The property name, where encodings could be stored
unicode MODIFY: "modify" token
unicode NONE: "none" token
unicode PROPCHANGE: "propchange" token

Method Details

__init__(self, config, groupset)
(Constructor)

Initialization
Overrides:
svnmailer.notifier._base.BaseNotifier.__init__

_addBody(self, doc)

Adds the actual commit info to the message
Parameters:
doc - The message document
           (type=DOM object)

_addGenerator(self, doc)

Adds the generator info to the message
Parameters:
doc - The message document
           (type=DOM object)

_addSource(self, doc)

Adds the source info to the message
Parameters:
doc - The message document
           (type=DOM object)

_addTextElements(self, parent, *elems)

Add multiple text elements
Parameters:
parent - The parent element
           (type=Element Node)
elems - The elements to add (name, value)
           (type=list of tuple)

_addTimeStamp(self, doc)

Adds revision timestamp to the message
Parameters:
doc - The message document
           (type=DOM object)

_getAuthorName(self)

Returns the name of the author

@return: The name @rtype: unicode

_getDiffLineCount(self)

Returns the number of changed lines

It counts the number of minus lines and the number of plus lines and returns the greater value.

Returns:
The diff line count or None
           (type=unicode)

_getFileAction(self, change)

Returns the action applied to the changed file
Parameters:
change - The change to process
           (type=svnmailer.subversion.VersionedPathDescriptor)
Returns:
The action
           (type=unicode)

To Do: file renaming?

_getFileType(self, change)

Returns the type of the modified file
Parameters:
change - The change to process
           (type=svnmailer.subversion.VersionedPathDescriptor)
Returns:
The type or None
           (type=unicode)

Notes:

  • currently it only marks directories as x-directory/normal
  • This is currently not implemented yet on server side
  • What do we do with different types (changed in the revision)?

_getFileUri(self, change)

Returns an URL associated with the changed file
Parameters:
change - The change to process
           (type=svnmailer.subversion.VersionedPathDescriptor)
Returns:
The URI or None
           (type=unicode)

To Do: add the ability to use raw subversion urls?

_getTagCount(self, diff_out)

Returns the number of changed lines for a diff
Parameters:
diff_out - The diff output (one opcode per item)
           (type=iterable)
Returns:
Number of changed lines
           (type=int)

_getTextElement(self, doc, name, value, attr=None)

Returns a new element containing text to the message
Parameters:
doc - The message document
           (type=DOM object)
name - The name of the element
           (type=unicode)
value - The content of the element
           (type=unicode)
attr - Attributes
           (type=dict)

_stripPath(self, path)

Returns the stripped path of a change
Parameters:
path - The path to strip
           (type=str)
Returns:
The stripped path
           (type=unicode)

composeCIAXMLMessage(self)

Composes the XML message to send

(a commit message according to the CIA schema)

Returns:
The message
           (type=DOM object)

deliverRPCMessage(self, doc)

Delivers the supplied message via XML-RPC
Parameters:
doc - The message document
           (type=DOM object)

run(self)

Submits notification via XMLRPC to a CIA server
Overrides:
svnmailer.notifier._base.BaseNotifier.run

Instance Variable Details

changeset

The changeset to process
Type:
list

config

The current group configuration
Type:
svnmailer.settings._base.GroupSettingsContainer

differ

The differ object
Type:
svnmailer.differ.*

Class Variable Details

__implements__

Type:
list
Value:
[<class 'svnmailer.notifier._base.BaseNotifier'>]                      

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