/head: changeset 88

Another attempt at fixing read-only folders
This commit is contained in:
jgoerzen 2002-07-09 04:05:34 +01:00
parent f18718615b
commit a6f5b1da98

View File

@ -45,11 +45,12 @@ class IMAPFolder(BaseFolder):
def getuidvalidity(self): def getuidvalidity(self):
imapobj = self.imapserver.acquireconnection() imapobj = self.imapserver.acquireconnection()
x = None
try: try:
try: try:
x = imapobj.status(self.getfullname(), '(UIDVALIDITY)')[1][0] x = imapobj.status(self.getfullname(), '(UIDVALIDITY)')[1][0]
except imapobj.readonly: except imapobj.readonly:
pass x = imapobj.status(self.getfullname(), '(UIDVALIDITY)')[1][0]
finally: finally:
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)
uidstring = imaputil.imapsplit(x)[1] uidstring = imaputil.imapsplit(x)[1]
@ -63,10 +64,11 @@ class IMAPFolder(BaseFolder):
except imapobj.readonly: except imapobj.readonly:
pass pass
self.messagelist = {} self.messagelist = {}
response = None
try: try:
response = imapobj.status(self.getfullname(), '(MESSAGES)')[1][0] response = imapobj.status(self.getfullname(), '(MESSAGES)')[1][0]
except imapobj.readonly: except imapobj.readonly:
pass response = imapobj.status(self.getfullname(), '(MESSAGES)')[1][0]
result = imaputil.imapsplit(response)[1] result = imaputil.imapsplit(response)[1]
maxmsgid = long(imaputil.flags2hash(result)['MESSAGES']) maxmsgid = long(imaputil.flags2hash(result)['MESSAGES'])
if (maxmsgid < 1): if (maxmsgid < 1):