Set accountname in BaseFolder, and don't pass it in initialization
We passed in the accountname to all derivatives of BaseFolder, such as IMAPFolder(...,repository,...,accountname), although it is perfectly possible to get the accountname from the Repository(). So remove this unneeded parameter. Each backend had to define getaccountname() (although the function is hardly used and most accessed .accountname directly). On the other hand BaseFolder was using getaccountname but it never defined the function. So make the sane thing, remove all definitions from backends and define accountname() once in Basefolder. It was made a property and not just a (public) attribute, so it will show up in our developer documentation as public API. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
c93cd9bb1a
commit
410e2d35e9
@ -32,7 +32,7 @@ except NameError:
|
||||
|
||||
|
||||
class IMAPFolder(BaseFolder):
|
||||
def __init__(self, imapserver, name, visiblename, accountname, repository):
|
||||
def __init__(self, imapserver, name, visiblename, repository):
|
||||
name = imaputil.dequote(name)
|
||||
super(IMAPFolder, self).__init__(name, repository)
|
||||
self.config = imapserver.config
|
||||
@ -42,7 +42,6 @@ class IMAPFolder(BaseFolder):
|
||||
self.imapserver = imapserver
|
||||
self.messagelist = None
|
||||
self.visiblename = visiblename
|
||||
self.accountname = accountname
|
||||
self.randomgenerator = random.Random()
|
||||
#self.ui is set in BaseFolder
|
||||
|
||||
@ -60,9 +59,6 @@ class IMAPFolder(BaseFolder):
|
||||
except imapobj.readonly:
|
||||
imapobj.select(self.getfullname(), readonly = 1)
|
||||
|
||||
def getaccountname(self):
|
||||
return self.accountname
|
||||
|
||||
def suggeststhreads(self):
|
||||
return 1
|
||||
|
||||
|
Reference in New Issue
Block a user