Implement foldersort in a python3 compatible way

By default we sort folders alphabetically (for IMAP) according to their
transposed names. For python3, we need to bend a bit backwards to still
allow the use of a cmp() function for foldersort. While going through, I
discovered that we never sort folders for Maildir.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-02-06 17:33:50 +01:00
parent 5c598d7e74
commit 19c014c6cd
3 changed files with 26 additions and 9 deletions

View File

@ -45,7 +45,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object):
self.nametrans = lambda foldername: foldername
self.folderfilter = lambda foldername: 1
self.folderincludes = []
self.foldersort = cmp
self.foldersort = None
if self.config.has_option(self.getsection(), 'nametrans'):
self.nametrans = self.localeval.eval(
self.getconf('nametrans'), {'re': re})