BaseFolder(): Save name and repository

As all Folders share these parameters, we can safely handle them in
BaseFolder. This makes sense, as BaseFolder has a getname() function
that returns self.name but nothing actually set self.name.

It also saves a few lines of code.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2011-09-16 10:54:22 +02:00
committed by Nicolas Sebrecht
parent 7941ea7e7d
commit c93cd9bb1a
5 changed files with 13 additions and 13 deletions

View File

@ -27,18 +27,16 @@ magicline = "OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1"
class LocalStatusFolder(BaseFolder):
def __init__(self, root, name, repository, accountname, config):
self.name = name
super(LocalStatusFolder, self).__init__(name, repository)
self.root = root
self.sep = '.'
self.config = config
self.filename = os.path.join(root, self.getfolderbasename())
self.messagelist = {}
self.repository = repository
self.savelock = threading.Lock()
self.doautosave = config.getdefaultboolean("general", "fsync", False)
"""Should we perform fsyncs as often as possible?"""
self.accountname = accountname
super(LocalStatusFolder, self).__init__()
def getaccountname(self):
return self.accountname