Package contacts :: Module contacts :: Class AbstractContactSynchronizationModule
[hide private]
[frames] | no frames]

Class AbstractContactSynchronizationModule

source code

pisiinterfaces.AbstractSynchronizationModule --+
                                               |
                                              AbstractContactSynchronizationModule
Known Subclasses:

Super class for all synchronization modules, which aim to synchronize contacts information.

Each Synchronization class implementing contact synchronization should inherit from this class.

Instance Methods [hide private]
 
__init__(self, verbose, soft, modulesString, config, configsection, name='unkown contact source')
Constructor
source code
 
_dePrefixNumbers(self, atts)
Some sources do support prefixes in phone numbers (such as tel: or sip:), this supporting functions helps to remove this information automatically
source code
 
_prefixNumbers(self, atts)
Some sources do support prefixes in phone numbers (such as tel: or sip:), this supporting functions helps to add this information automatically
source code
 
addContact(self, contactInstance)
Saves a contact for later writing
source code
 
allContacts(self)
Getter.
source code
 
flush(self)
Remove all entries in repository
source code
 
getContact(self, id)
GETTER
source code
 
removeContact(self, id)
Removes a contact entry
source code
 
replaceContact(self, id, updatedContact)
Replaces an existing contact entry with a new one.
source code

Inherited from pisiinterfaces.AbstractSynchronizationModule: addEntry, allEntries, getDescription, getEntry, getName, postProcess, preProcess, prettyPrint, removeEntry, replaceEntry

Instance Variables [hide private]
  _allContacts
Dictionary to hold all contact instance for the implementation.
  _history
Keeps track of all changes applied to the container for this data source (for later write through)
Method Details [hide private]

__init__(self, verbose, soft, modulesString, config, configsection, name='unkown contact source')
(Constructor)

source code 

Constructor

Instance variables are initialized.

Overrides: pisiinterfaces.AbstractSynchronizationModule.__init__

addContact(self, contactInstance)

source code 

Saves a contact for later writing

One entry is added to the history list (_history) with action id for 'add' and the new instance is stored in the contacts dictionary (_allContacts).

allContacts(self)

source code 

Getter.

Returns:
The link to the instance variable _allContacts.

flush(self)

source code 

Remove all entries in repository

An entry in the history list (_history) is appended for each entry in the contact list with action id for 'delete'. Afterwards, the dictionary for all contacts (_allContacts) is flushed.

Overrides: pisiinterfaces.AbstractSynchronizationModule.flush

getContact(self, id)

source code 

GETTER

Returns:
The link with the given ID.

removeContact(self, id)

source code 

Removes a contact entry

One entry is added to the history list (_history) with action id for 'delete' and the instance is as well removed from the contacts dictionary (_allContacts).

replaceContact(self, id, updatedContact)

source code 

Replaces an existing contact entry with a new one.

One entry is added to the history list (_history) with action id for 'replace' and the old instance is replaced by the new one in the contacts dictionary (_allContacts).