Module pisi
[hide private]
[frames] | no frames]

Module pisi

source code

Main module for PISI

This file is part of Pisi.

This file is the python module to be started for running PISI. Initialization is performed in here:

Pisi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Pisi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Pisi. If not, see <http://www.gnu.org/licenses/>.

Functions [hide private]
 
getConfiguration()
Returns the entire content of the configuration file
source code
 
readConfiguration()
Loads configuration from the configuration file and returns the container with all the information as well as the config folder
source code
 
importModules(configfolder, config, modulesToLoad, modulesNamesCombined, soft)
Imports the required modules for handling the specific data sources
source code
 
determineMode(config, modulesToLoad)
Check, what type of information we have to synchronize
source code
 
applyChanges(source)
Write changes through to data source backends
source code
 
determineConflictDetails(entry1, entry2) source code
Variables [hide private]
  ACTIONID_ADD = 0
  ACTIONID_DELETE = 1
  ACTIONID_MODIFY = 2
  CONSOLE_PROGRESSBAR_WIDTH = 80
  FILEDOWNLOAD_TIMEOUT = 10
  FILEDOWNLOAD_TMPFILE = '/tmp/pisi-remotebuffer.data'
  FILEPATH_COPYING = '/opt/pisi/COPYING'
  GOOGLE_CALENDAR_APPNAME = 'pisi0.5'
  GOOGLE_CALENDAR_MAXRESULTS = 1000
  GOOGLE_CONTACTS_APPNAME = 'pisi0.5'
  GOOGLE_CONTACTS_MAXRESULTS = 1000
  ICS_BYTES_PER_ENTRY = 200
  MERGEMODE_FLUSH_A = 1
  MERGEMODE_FLUSH_B = 2
  MERGEMODE_MANUALCONFIRM = 5
  MERGEMODE_OVERWRITE_A = 3
  MERGEMODE_OVERWRITE_B = 4
  MERGEMODE_SKIP = 0
  MERGEMODE_STRINGS = ['Skip', 'Flush source 1', 'Flush source 2...
  MODE_CALENDAR = 0
  MODE_CONTACTS = 1
  MODE_STRINGS = ['calendar', 'contacts']
  PISI_AUTHORS = ['Esben Damgaard', 'Michael Pilgermann']
  PISI_COMMENTS = 'PISI is synchronizing information'
  PISI_DOCUMENTERS = ['Michael Pilgermann']
  PISI_HOMEPAGE = 'http://freshmeat.net/projects/pisiom'
  PISI_NAME = 'PISI'
  PISI_TRANSLATOR_CREDITS = None
  PISI_VERSION = '0.5'
  VCF_BYTES_PER_ENTRY = 200
  __package__ = None
Function Details [hide private]

importModules(configfolder, config, modulesToLoad, modulesNamesCombined, soft)

source code 

Imports the required modules for handling the specific data sources

The required modules had been determined by examining the chosen data sources. The required modules are now imported.

determineMode(config, modulesToLoad)

source code 

Check, what type of information we have to synchronize

Checks, whether the two modules (for the given data sources) are equal in type for data they can sync (contacts - contacts or calendar - calendar). This is done by simply comparing the starting part of the module names (all stuff left from '_'); this is a naming convention. E.g. contacts_ldap and contacts_sqlite3 would return 'CONTACTS' mode, whereby contacts_ldap and calendar_google would raise an error. An error is thrown whenever the two sources do not match in type, or if a type is not known or unvalid..

applyChanges(source)

source code 

Write changes through to data source backends

All changes in syncing are only performed in memory. This function finally requests the data sources to make their changes permanent by calling the corresponding function in there.


Variables Details [hide private]

MERGEMODE_STRINGS

Value:
['Skip',
 'Flush source 1',
 'Flush source 2',
 'Overwrite entry in source 1',
 'Overwrite entry in source 2',
 'Manual confirmation']