/head: changeset 63

Modified to new imapserver semantics
This commit is contained in:
jgoerzen 2002-07-04 01:15:32 +01:00
parent 8df2ac0a47
commit aff34d096c

View File

@ -28,10 +28,8 @@ class IMAPRepository(BaseRepository):
self.imapserver = imapserver self.imapserver = imapserver
self.config = config self.config = config
self.accountname = accountname self.accountname = accountname
self.imapobj = imapserver.makeconnection()
self.folders = None self.folders = None
self.nametrans = lambda foldername: foldername self.nametrans = lambda foldername: foldername
self.maxconnections = config.getint(accountname, 'maxconnections')
if config.has_option(accountname, 'nametrans'): if config.has_option(accountname, 'nametrans'):
self.nametrans = eval(config.get(accountname, 'nametrans')) self.nametrans = eval(config.get(accountname, 'nametrans'))
@ -46,7 +44,12 @@ class IMAPRepository(BaseRepository):
if self.folders != None: if self.folders != None:
return self.folders return self.folders
retval = [] retval = []
for string in self.imapobj.list()[1]: imapobj = self.imapserver.acquireconnection()
try:
listresult = imapobj.list()[1]
finally:
self.imapserver.releaseconnection(imapobj)
for string in listresult:
flags, delim, name = imaputil.imapsplit(string) flags, delim, name = imaputil.imapsplit(string)
if '\\Noselect' in imaputil.flagsplit(flags): if '\\Noselect' in imaputil.flagsplit(flags):
continue continue