1 """
2 Synchronize with simple dump file (used by Paroli)
3
4 This file is part of Pisi.
5
6 Logic is taken from U{http://www.mail-archive.com/support@lists.openmoko.org/msg04770.html}.
7
8 Pisi is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 Pisi is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Pisi. If not, see <http://www.gnu.org/licenses/>.
20 """
21 from contacts import contacts
22 from pisiconstants import *
23 import pisiprogress
24
25 from tichy.service import Service
26
28 - def __init__( self, modulesString, config, configsection, folder, verbose=False, soft=False):
29 """
30 Constructor
31
32 Super class constructor (L{contacts.AbstractContactSynchronizationModule.__init__}) is called.
33 Local variables are initialized.
34 The settings from the configuration file are loaded.
35
36 @param modulesString: is a small string to help you make a unique id. It is the two modules configuration-names concatinated.
37 @param config: is the configuration from ~/.pisi/conf. Use like config.get(configsection,'user')
38 @param configsection: is the configuration from ~/.pisi/conf. Use like config.get(configsection,'user')
39 @param folder: is a string with the location for where your module can save its own files if necessary
40 @param verbose: should make your module "talk" more
41 @param soft: should tell you if you should make changes (ie. save)
42 """
43 contacts.AbstractContactSynchronizationModule.__init__(self, verbose, soft, modulesString, config, configsection, "Contacts Paroli")
44 self.verbose = verbose
45 pisiprogress.getCallback().verbose("Paroli module loaded")
46 self._path = config.get(configsection,'path')
47
49 """
50 Load all data from backend
51 """
52 pass
53
55 """
56 Writing through: Adds a single value to the Paroli backend
57 """
58 c = self.getContact(id)
59 fullName = pisitools.assembleFullName(c)
60 number = c.attributes['mobile']
61 pass
62
64 """
65 Writing through: Removes a single value from the Paroli backend
66 """
67 pass
68
95