Remove visiblename as parameter to IMAPFolder creation
IMAPFolder has the repository and foldername values so it can get the transposed (aka visiblename) of a folder itself just fine. There is no need to pass it in as an separate parameter. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
80e87d0d99
commit
0d3303ec12
@ -33,9 +33,8 @@ class GmailFolder(IMAPFolder):
|
|||||||
http://mail.google.com/support/bin/answer.py?answer=77657&topic=12815
|
http://mail.google.com/support/bin/answer.py?answer=77657&topic=12815
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, imapserver, name, visiblename, repository):
|
def __init__(self, imapserver, name, repository):
|
||||||
super(GmailFolder, self).__init__(imapserver, name, visiblename,
|
super(GmailFolder, self).__init__(imapserver, name, repository)
|
||||||
repository)
|
|
||||||
self.realdelete = repository.getrealdelete(name)
|
self.realdelete = repository.getrealdelete(name)
|
||||||
self.trash_folder = repository.gettrashfolder(name)
|
self.trash_folder = repository.gettrashfolder(name)
|
||||||
#: Gmail will really delete messages upon EXPUNGE in these folders
|
#: Gmail will really delete messages upon EXPUNGE in these folders
|
||||||
|
@ -32,7 +32,7 @@ except NameError:
|
|||||||
|
|
||||||
|
|
||||||
class IMAPFolder(BaseFolder):
|
class IMAPFolder(BaseFolder):
|
||||||
def __init__(self, imapserver, name, visiblename, repository):
|
def __init__(self, imapserver, name, repository):
|
||||||
name = imaputil.dequote(name)
|
name = imaputil.dequote(name)
|
||||||
super(IMAPFolder, self).__init__(name, repository)
|
super(IMAPFolder, self).__init__(name, repository)
|
||||||
self.expunge = repository.getexpunge()
|
self.expunge = repository.getexpunge()
|
||||||
@ -40,7 +40,7 @@ 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 = visiblename
|
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
|
||||||
|
|
||||||
|
@ -259,9 +259,7 @@ class IMAPRepository(BaseRepository):
|
|||||||
|
|
||||||
|
|
||||||
def getfolder(self, foldername):
|
def getfolder(self, foldername):
|
||||||
return self.getfoldertype()(self.imapserver, foldername,
|
return self.getfoldertype()(self.imapserver, foldername, self)
|
||||||
self.nametrans(foldername),
|
|
||||||
self)
|
|
||||||
|
|
||||||
def getfoldertype(self):
|
def getfoldertype(self):
|
||||||
return folder.IMAP.IMAPFolder
|
return folder.IMAP.IMAPFolder
|
||||||
@ -302,7 +300,6 @@ class IMAPRepository(BaseRepository):
|
|||||||
foldername)
|
foldername)
|
||||||
continue
|
continue
|
||||||
retval.append(self.getfoldertype()(self.imapserver, foldername,
|
retval.append(self.getfoldertype()(self.imapserver, foldername,
|
||||||
self.nametrans(foldername),
|
|
||||||
self))
|
self))
|
||||||
if len(self.folderincludes):
|
if len(self.folderincludes):
|
||||||
imapobj = self.imapserver.acquireconnection()
|
imapobj = self.imapserver.acquireconnection()
|
||||||
@ -319,7 +316,6 @@ class IMAPRepository(BaseRepository):
|
|||||||
continue
|
continue
|
||||||
retval.append(self.getfoldertype()(self.imapserver,
|
retval.append(self.getfoldertype()(self.imapserver,
|
||||||
foldername,
|
foldername,
|
||||||
self.nametrans(foldername),
|
|
||||||
self))
|
self))
|
||||||
finally:
|
finally:
|
||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
|
Loading…
Reference in New Issue
Block a user