Init folder list early enough

We need the list of folders and the folder delimiter, but it was not
always retrieved early enough. E.g. when doing IMAP<->IMAP sync and the
local IMAP being readonly, we would bunk out with a mysterious error
message become repository.getsel() would still return None.

This commit fixes this error.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-12-01 10:27:12 +01:00
parent bf4127c2d6
commit c93f8710a3
2 changed files with 12 additions and 0 deletions

View File

@ -31,3 +31,8 @@ Changes
Bug Fixes Bug Fixes
--------- ---------
* IMAP<->IMAP sync with a readonly local IMAP repository failed with a
rather mysterious "TypeError: expected a character buffer object"
error. Fix this my retrieving the list of folders early enough even
for readonly repositories.

View File

@ -274,6 +274,13 @@ class SyncableAccount(Account):
remoterepos = self.remoterepos remoterepos = self.remoterepos
localrepos = self.localrepos localrepos = self.localrepos
statusrepos = self.statusrepos statusrepos = self.statusrepos
# init repos with list of folders, so we have them (and the
# folder delimiter etc)
remoterepos.getfolders()
localrepos.getfolders()
statusrepos.getfolders()
# replicate the folderstructure between REMOTE to LOCAL # replicate the folderstructure between REMOTE to LOCAL
if not localrepos.getconfboolean('readonly', False): if not localrepos.getconfboolean('readonly', False):
self.ui.syncfolders(remoterepos, localrepos) self.ui.syncfolders(remoterepos, localrepos)