[PATCH 4/4] Make syncfoldersto to accept a single folder only
Vladimir.Marek at oracle.com
Vladimir.Marek at oracle.com
Tue Aug 16 09:55:16 BST 2011
From: Vladimir Marek <vlmarek at volny.cz>
It is just historic relict
Signed-off-by: Vladimir Marek <vlmarek at volny.cz>
---
offlineimap/accounts.py | 2 +-
offlineimap/repository/Base.py | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py
index 8653d48..31ea2b7 100644
--- a/offlineimap/accounts.py
+++ b/offlineimap/accounts.py
@@ -233,7 +233,7 @@ class SyncableAccount(Account):
# replicate the folderstructure from REMOTE to LOCAL
if not localrepos.getconf('readonly', False):
self.ui.syncfolders(remoterepos, localrepos)
- remoterepos.syncfoldersto(localrepos, [statusrepos])
+ remoterepos.syncfoldersto(localrepos, statusrepos)
# iterate through all folders on the remote repo and sync
for remotefolder in remoterepos.getfolders():
diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py
index ae4d32c..f96a33d 100644
--- a/offlineimap/repository/Base.py
+++ b/offlineimap/repository/Base.py
@@ -114,12 +114,12 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
def getfolder(self, foldername):
raise NotImplementedError
- def syncfoldersto(self, dest, copyfolders):
+ def syncfoldersto(self, dest, status):
"""Syncs the folders in this repository to those in dest.
It does NOT sync the contents of those folders.
- For every time dest.makefolder() is called, also call makefolder()
- on each folder in copyfolders."""
+ Whenever makefolder() is called, also call makefolder() on status
+ folder."""
src = self
srcfolders = src.getfolders()
destfolders = dest.getfolders()
@@ -143,8 +143,7 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
if not key in desthash:
try:
dest.makefolder(key)
- for copyfolder in copyfolders:
- copyfolder.makefolder(key.replace(dest.getsep(), copyfolder.getsep()))
+ status.makefolder(key.replace(dest.getsep(), status.getsep()))
except (KeyboardInterrupt):
raise
except:
--
Vlad
More information about the OfflineIMAP-project
mailing list