Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap

This commit is contained in:
John Goerzen 2009-07-12 08:53:18 -05:00
commit dd351a2465
2 changed files with 12 additions and 12 deletions

View File

@ -37,9 +37,9 @@ class SigListener(Queue):
# folders haven't yet been added, or this account is once-only; drop signal # folders haven't yet been added, or this account is once-only; drop signal
return return
elif self.folders: elif self.folders:
for folder in self.folders: for foldernr in range(len(self.folders)):
# requeue folder # requeue folder
self.folders[folder] = True self.folders[foldernr][1] = True
self.quick = False self.quick = False
return return
# else folders have already been cleared, put signal... # else folders have already been cleared, put signal...
@ -49,22 +49,22 @@ class SigListener(Queue):
def addfolders(self, remotefolders, autorefreshes, quick): def addfolders(self, remotefolders, autorefreshes, quick):
self.folderlock.acquire() self.folderlock.acquire()
try: try:
self.folders = {} self.folders = []
self.quick = quick self.quick = quick
self.autorefreshes = autorefreshes self.autorefreshes = autorefreshes
for folder in remotefolders: for folder in remotefolders:
# new folders are queued # new folders are queued
self.folders[folder] = True self.folders.append([folder, True])
finally: finally:
self.folderlock.release() self.folderlock.release()
def clearfolders(self): def clearfolders(self):
self.folderlock.acquire() self.folderlock.acquire()
try: try:
for folder in self.folders: for folder, queued in self.folders:
if self.folders[folder]: if queued:
# some folders still in queue # some folders still in queue
return False return False
self.folders.clear() self.folders[:] = []
return True return True
finally: finally:
self.folderlock.release() self.folderlock.release()
@ -74,10 +74,10 @@ class SigListener(Queue):
dirty = True dirty = True
while dirty: while dirty:
dirty = False dirty = False
for folder in self.folders: for foldernr, (folder, queued) in enumerate(self.folders):
if self.folders[folder]: if queued:
# mark folder as no longer queued # mark folder as no longer queued
self.folders[folder] = False self.folders[foldernr][1] = False
dirty = True dirty = True
quick = self.quick quick = self.quick
self.folderlock.release() self.folderlock.release()

View File

@ -88,8 +88,8 @@ class MaildirFolder(BaseFolder):
folderstr = ',FMD5=' + foldermd5 folderstr = ',FMD5=' + foldermd5
for dirannex in ['new', 'cur']: for dirannex in ['new', 'cur']:
fulldirname = os.path.join(self.getfullname(), dirannex) fulldirname = os.path.join(self.getfullname(), dirannex)
files.extend([os.path.join(fulldirname, filename) for files.extend(os.path.join(fulldirname, filename) for
filename in os.listdir(fulldirname)]) filename in os.listdir(fulldirname))
for file in files: for file in files:
messagename = os.path.basename(file) messagename = os.path.basename(file)
foldermatch = messagename.find(folderstr) != -1 foldermatch = messagename.find(folderstr) != -1