From 6b2ec956cfe8e356d3ffd54eee34773deb73279f Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 19 Sep 2011 13:41:38 +0200 Subject: [PATCH] Apply nametrans to all Foldertypes getvisiblename() was only defined on IMAP(derived) foldertypes, but we want it on eg. Maildirs too, so we define it centrally in Folder.Base.py rather than only in folder.IMAP.py. Signed-off-by: Sebastian Spaeth --- offlineimap/folder/Base.py | 4 +++- offlineimap/folder/IMAP.py | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 3cfb18f..d9fed70 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -38,6 +38,7 @@ class BaseFolder(object): self.ui = getglobalui() self.name = name self.repository = repository + self.visiblename = repository.nametrans(name) self.config = repository.getconfig() def getname(self): @@ -69,7 +70,8 @@ class BaseFolder(object): return 1 def getvisiblename(self): - return self.name + """The nametrans-transposed name of the folder's name""" + return self.visiblename def getrepository(self): """Returns the repository object that this folder is within.""" diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index ea86d15..041f5a0 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -40,7 +40,6 @@ class IMAPFolder(BaseFolder): self.sep = imapserver.delim self.imapserver = imapserver self.messagelist = None - self.visiblename = repository.nametrans(name) self.randomgenerator = random.Random() #self.ui is set in BaseFolder @@ -67,9 +66,6 @@ class IMAPFolder(BaseFolder): def getcopyinstancelimit(self): return 'MSGCOPY_' + self.repository.getname() - def getvisiblename(self): - return self.visiblename - def getuidvalidity(self): imapobj = self.imapserver.acquireconnection() try: