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 <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-19 13:41:38 +02:00
parent 7d34060217
commit 6b2ec956cf
2 changed files with 3 additions and 5 deletions

View File

@ -38,6 +38,7 @@ class BaseFolder(object):
self.ui = getglobalui() self.ui = getglobalui()
self.name = name self.name = name
self.repository = repository self.repository = repository
self.visiblename = repository.nametrans(name)
self.config = repository.getconfig() self.config = repository.getconfig()
def getname(self): def getname(self):
@ -69,7 +70,8 @@ class BaseFolder(object):
return 1 return 1
def getvisiblename(self): def getvisiblename(self):
return self.name """The nametrans-transposed name of the folder's name"""
return self.visiblename
def getrepository(self): def getrepository(self):
"""Returns the repository object that this folder is within.""" """Returns the repository object that this folder is within."""

View File

@ -40,7 +40,6 @@ class IMAPFolder(BaseFolder):
self.sep = imapserver.delim self.sep = imapserver.delim
self.imapserver = imapserver self.imapserver = imapserver
self.messagelist = None self.messagelist = None
self.visiblename = repository.nametrans(name)
self.randomgenerator = random.Random() self.randomgenerator = random.Random()
#self.ui is set in BaseFolder #self.ui is set in BaseFolder
@ -67,9 +66,6 @@ class IMAPFolder(BaseFolder):
def getcopyinstancelimit(self): def getcopyinstancelimit(self):
return 'MSGCOPY_' + self.repository.getname() return 'MSGCOPY_' + self.repository.getname()
def getvisiblename(self):
return self.visiblename
def getuidvalidity(self): def getuidvalidity(self):
imapobj = self.imapserver.acquireconnection() imapobj = self.imapserver.acquireconnection()
try: try: