minor: add comments
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
c2b8a99fa2
commit
a44718130d
@ -33,15 +33,21 @@ except:
|
|||||||
|
|
||||||
# FIXME: spaghetti code alert!
|
# FIXME: spaghetti code alert!
|
||||||
def getaccountlist(customconfig):
|
def getaccountlist(customconfig):
|
||||||
|
# Account names in a list.
|
||||||
return customconfig.getsectionlist('Account')
|
return customconfig.getsectionlist('Account')
|
||||||
|
|
||||||
# FIXME: spaghetti code alert!
|
# FIXME: spaghetti code alert!
|
||||||
def AccountListGenerator(customconfig):
|
def AccountListGenerator(customconfig):
|
||||||
|
"""Returns a list of instanciated Account class, one per account name."""
|
||||||
|
|
||||||
return [Account(customconfig, accountname)
|
return [Account(customconfig, accountname)
|
||||||
for accountname in getaccountlist(customconfig)]
|
for accountname in getaccountlist(customconfig)]
|
||||||
|
|
||||||
# FIXME: spaghetti code alert!
|
# FIXME: spaghetti code alert!
|
||||||
def AccountHashGenerator(customconfig):
|
def AccountHashGenerator(customconfig):
|
||||||
|
"""Returns a dict of instanciated Account class with the account name as
|
||||||
|
key."""
|
||||||
|
|
||||||
retval = {}
|
retval = {}
|
||||||
for item in AccountListGenerator(customconfig):
|
for item in AccountListGenerator(customconfig):
|
||||||
retval[item.getname()] = item
|
retval[item.getname()] = item
|
||||||
|
@ -40,6 +40,8 @@ CRLF = '\r\n'
|
|||||||
|
|
||||||
class IMAPFolder(BaseFolder):
|
class IMAPFolder(BaseFolder):
|
||||||
def __init__(self, imapserver, name, repository):
|
def __init__(self, imapserver, name, repository):
|
||||||
|
# FIXME: decide if unquoted name is from the responsability of the
|
||||||
|
# caller or not, but not both.
|
||||||
name = imaputil.dequote(name)
|
name = imaputil.dequote(name)
|
||||||
self.sep = imapserver.delim
|
self.sep = imapserver.delim
|
||||||
super(IMAPFolder, self).__init__(name, repository)
|
super(IMAPFolder, self).__init__(name, repository)
|
||||||
|
@ -321,6 +321,8 @@ class OfflineImap:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Honor CLI --account option, only.
|
||||||
|
# Accounts to sync are put into syncaccounts variable.
|
||||||
activeaccounts = self.config.get("general", "accounts")
|
activeaccounts = self.config.get("general", "accounts")
|
||||||
if options.accounts:
|
if options.accounts:
|
||||||
activeaccounts = options.accounts
|
activeaccounts = options.accounts
|
||||||
|
@ -301,6 +301,8 @@ class IMAPRepository(BaseRepository):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def getfolder(self, foldername):
|
def getfolder(self, foldername):
|
||||||
|
"""Return instance of OfflineIMAP representative folder."""
|
||||||
|
|
||||||
return self.getfoldertype()(self.imapserver, foldername, self)
|
return self.getfoldertype()(self.imapserver, foldername, self)
|
||||||
|
|
||||||
def getfoldertype(self):
|
def getfoldertype(self):
|
||||||
@ -314,6 +316,8 @@ class IMAPRepository(BaseRepository):
|
|||||||
self.folders = None
|
self.folders = None
|
||||||
|
|
||||||
def getfolders(self):
|
def getfolders(self):
|
||||||
|
"""Return a list of instances of OfflineIMAP representative folder."""
|
||||||
|
|
||||||
if self.folders != None:
|
if self.folders != None:
|
||||||
return self.folders
|
return self.folders
|
||||||
retval = []
|
retval = []
|
||||||
|
Loading…
Reference in New Issue
Block a user