Maildir: Call top-level directory '', not '.'

If nametrans translates to an empty directory we want to find the
top-level directory by name '' and not by name '.'. This unbreaks
nametrans rules that result in empty folder names.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-19 14:14:44 +02:00
parent 792243c78f
commit a279aa7307

View File

@ -146,7 +146,7 @@ class MaildirRepository(BaseRepository):
self.debug(" toppath = %s" % toppath) self.debug(" toppath = %s" % toppath)
# Iterate over directories in top & top itself. # Iterate over directories in top & top itself.
for dirname in os.listdir(toppath) + ['.']: for dirname in os.listdir(toppath) + ['']:
self.debug(" *** top of loop") self.debug(" *** top of loop")
self.debug(" dirname = %s" % dirname) self.debug(" dirname = %s" % dirname)
if dirname in ['cur', 'new', 'tmp']: if dirname in ['cur', 'new', 'tmp']:
@ -173,7 +173,7 @@ class MaildirRepository(BaseRepository):
foldername, foldername,
self.getsep(), self.getsep(),
self)) self))
if self.getsep() == '/' and dirname != '.': if self.getsep() == '/' and dirname != '':
# Recursively check sub-directories for folders too. # Recursively check sub-directories for folders too.
retval.extend(self._getfolders_scandir(root, foldername)) retval.extend(self._getfolders_scandir(root, foldername))
self.debug("_GETFOLDERS_SCANDIR RETURNING %s" % \ self.debug("_GETFOLDERS_SCANDIR RETURNING %s" % \