Package svnmailer :: Module differ :: Class ExternalDiffer

[hide private]

# Class ExternalDiffer

source code

    object --+
             |
            ExternalDiffer

Differ which calls an external program (e.g. diff)

Instance Methods | [hide private]

__init__(self, diff_command, tempdir=None) Initialization | source code

iterable

getStringDiff(self, string1, string2, label1, label2=None, date1=`'````'`, date2=`'````'`) creates a diff of two line based strings | source code

iterable

getFileDiff(self, name1, name2, label1, label2=None, date1=`'````'`, date2=`'````'`) creates a diff of two line based files | source code

see: `util.getPipe4`

_getPipe(self, name1, name2, label1, label2, date1, date2) Returns a pipe from the diff program | source code

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

Instance Variables | [hide private]

`list` | _diff_command The diff command line
`str` | _tempdir The tempdir to use for string diffs

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, diff_command, tempdir=None)
(Constructor)

source code

Initialization

Parameters:
  - `diff_command` (`list`) - The diff command to call
  - `tempdir` (`str`) - The tempdir to use for string diffs
Overrides: object.__init__

### getStringDiff(self, string1, string2, label1, label2=None, date1=`'````'`, date2=`'````'`)

source code

creates a diff of two line based strings

If a string is `None`, it's treated as ""

Parameters:
  - `string1` (`str`) - First string
  - `string2` (`str`) - Second string
  - `label1` (`str`) - Label for first data
  - `label2` (`str`) - Label for second data
  - `date1` (`str`) - Date description for first data
  - `date2` (`str`) - Date description for second data
Returns: iterable
  unified diff lines (maybe a generator)

### getFileDiff(self, name1, name2, label1, label2=None, date1=`'````'`, date2=`'````'`)

source code

creates a diff of two line based files

Parameters:
  - `name1` (`str`) - First file name
  - `name2` (`str`) - Second file name
  - `label1` (`str`) - Label for first data
  - `label2` (`str`) - Label for second data
  - `date1` (`str`) - Date description for first data
  - `date2` (`str`) - Date description for second data
Returns: iterable
  unified diff lines (maybe a generator)

### _getPipe(self, name1, name2, label1, label2, date1, date2)

source code

Returns a pipe from the diff program

Parameters:
  - `name1` (`str`) - First file name
  - `name2` (`str`) - Second file name
  - `label1` (`str`) - Label for first data
  - `label2` (`str`) - Label for second data
  - `date1` (`str`) - Date description for first data
  - `date2` (`str`) - Date description for second data
Returns: see: `util.getPipe4`
  The pipe object