]>
code.delx.au - offlineimap/blob - offlineimap/head/offlineimap/repository/Base.py
e0aae0082bd94e342d567d892c9d9332ab848594
1 # Base repository support
2 # Copyright (C) 2002 John Goerzen
3 # <jgoerzen@complete.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 """Returns a list of ALL folders on this server."""
24 raise NotImplementedError
26 def makefolder(self
, foldername
):
27 raise NotImplementedError
29 def deletefolder(self
, foldername
):
30 raise NotImplementedError
32 def getfolder(self
, foldername
):
33 raise NotImplementedError
35 def syncfoldersto(self
, dest
):
36 """Syncs the folders in this repository to those in dest.
37 It does NOT sync the contents of those folders."""
39 srcfolders
= src
.getfolders()
40 destfolders
= dest
.getfolders()
42 # Create hashes with the names, but convert the source folders
43 # to the dest folder's sep.
46 for folder
in srcfolders
:
47 srchash
[folder
.getvisiblename().replace(src
.getsep(), dest
.getsep())] = \
50 for folder
in destfolders
:
51 desthash
[folder
.getvisiblename()] = folder
57 for key
in srchash
.keys():
58 if not key
in desthash
:
62 # Find deleted folders.
64 # We don't delete folders right now.
66 #for key in desthash.keys():
67 # if not key in srchash:
68 # dest.deletefolder(key)