Package svnmailer :: Package notifier :: Module cia_xmlrpc :: Class CIAXMLRPCNotifier

[hide private]

# Class CIAXMLRPCNotifier

source code

            object --+
                     |
    _base.BaseNotifier --+
                         |
                        CIAXMLRPCNotifier

The CIA XML-RPC Notifier class

Instance Methods | [hide private]

__init__(self, config, groupset) Initialization | source code

run(self) Submits notification via XMLRPC to a CIA server | source code

deliverRPCMessage(self, rpc_server, doc) Delivers the supplied message via XML-RPC | source code

DOM object

composeCIAXMLMessage(self) Composes the XML message to send | source code

_addTimeStamp(self, doc) Adds revision timestamp to the message | source code

_addGenerator(self, doc) Adds the generator info to the message | source code

_addSource(self, doc) Adds the source info to the message | source code

_addBody(self, doc) Adds the actual commit info to the message | source code

`unicode`

_getDiffLineCount(self) Returns the number of changed lines | source code

`int`

_getMinusPlusCount(self, diff_out) Returns the number of changed lines for a diff | source code

`unicode`

_getFileUri(self, change) Returns an URL associated with the changed file | source code

`unicode`

_getFileAction(self, change) Returns the action applied to the changed file | source code

`unicode`

_getFileType(self, change) Returns the type of the modified file | source code

`unicode`

_stripPath(self, path) Returns the stripped path of a change | source code

`unicode`

_getAuthorName(self) Returns the name of the author | source code

_addTextElements(self, parent, *elems) Add multiple text elements | source code

_getTextElement(self, doc, name, value, attr=None) Returns a new element containing text to the message | source code

Inherited from `_base.BaseNotifier`: `dumpContent`, `getAuthor`, `getContentDiffAction`, `getContentDiffUrl`, `getContentEncodingProperty`, `getContentEncodings`, `getDiffTokens`, `getDiffer`, `getEncodingFromMimeType`, `getLog`, `getPropertyDiffAction`, `getTempDir`, `getTempFile`, `getTime`, `getUrl`, `isBinaryProperty`, `isOneLineProperty`, `isUTF8Property`

Inherited from `_base.BaseNotifier` (private): `_getContentEncoding`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| __implements__ = ``[`<class 'svnmailer.notifier._base.BaseNotifie`...``
Inherited from `_base.BaseNotifier`: `ADD`, `COPY`, `DELETE`, `ENC_CONFIG`, `ENC_DEFAULT`, `ENC_PROPERTY`, `MODIFY`, `NONE`, `PROPCHANGE` Inherited from `_base.BaseNotifier` (private): `_diffable_tests`

Instance Variables | [hide private]

`list` | changeset The changeset to process
`svnmailer.settings.GroupSettingsContainer` | config The current group configuration
`svnmailer.differ.*` | differ The differ object
Inherited from `_base.BaseNotifier` (private): `_groupset`, `_penc_cache`, `_settings`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, config, groupset)
(Constructor)

source code

Initialization

Overrides: object.__init__

### run(self)

source code

Submits notification via XMLRPC to a CIA server

Overrides: _base.BaseNotifier.run

### deliverRPCMessage(self, rpc_server, doc)

source code

Delivers the supplied message via XML-RPC

Parameters:
  - `rpc_server` (`unicode`) - The server to deliver to
  - `doc` (DOM object) - The message document

### composeCIAXMLMessage(self)

source code

Composes the XML message to send

(a commit message according to http://navi.cx/svn/misc/trunk/cia/xml/schema.xsd)

Returns: DOM object
  The message

### _addTimeStamp(self, doc)

source code

Adds revision timestamp to the message

Parameters:
  - `doc` (DOM object) - The message document

### _addGenerator(self, doc)

source code

Adds the generator info to the message

Parameters:
  - `doc` (DOM object) - The message document

### _addSource(self, doc)

source code

Adds the source info to the message

Parameters:
  - `doc` (DOM object) - The message document

### _addBody(self, doc)

source code

Adds the actual commit info to the message

Parameters:
  - `doc` (DOM object) - The message document

### _getDiffLineCount(self)

source code

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: `unicode`
  The diff line count or `None`

### _getMinusPlusCount(self, diff_out)

source code

Returns the number of changed lines for a diff

Parameters:
  - `diff_out` (iterable) - The diff output (one diff line per item)
Returns: `int`
  Number of changed lines

### _getFileUri(self, change)

source code

Returns an URL associated with the changed file

Parameters:
  - `change` (`svnmailer.subversion.VersionedPathDescriptor`) - The change to process
Returns: `unicode`
  The URI or `None`

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

### _getFileAction(self, change)

source code

Returns the action applied to the changed file

Parameters:
  - `change` (`svnmailer.subversion.VersionedPathDescriptor`) - The change to process
Returns: `unicode`
  The action

To Do: file renaming?

### _getFileType(self, change)

source code

Returns the type of the modified file

Parameters:
  - `change` (`svnmailer.subversion.VersionedPathDescriptor`) - The change to process
Returns: `unicode`
  The type or `None`

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)?

### _stripPath(self, path)

source code

Returns the stripped path of a change

Parameters:
  - `path` (`str`) - The path to strip
Returns: `unicode`
  The stripped path

### _getAuthorName(self)

source code

Returns the name of the author

Returns: `unicode`
  The name

### _addTextElements(self, parent, *elems)

source code

Add multiple text elements

Parameters:
  - `parent` (Element Node) - The parent element
  - `elems` (`list` of `tuple`) - The elements to add (name, value)

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

source code

Returns a new element containing text to the message

Parameters:
  - `doc` (DOM object) - The message document
  - `name` (`unicode`) - The name of the element
  - `value` (`unicode`) - The content of the element
  - `attr` (`dict`) - Attributes

Class Variable Details | [hide private]

### __implements__

Value:

      [<class 'svnmailer.notifier._base.BaseNotifier'>]