Reformat offlineimap/folder/IMAP.py

Add some spaces, remove lines,... now format is better (lintian).
This commit is contained in:
Rodolfo García Peñas (kix) 2020-08-29 19:51:25 +02:00
parent 3d1360a7e3
commit 80ee751243

View File

@ -509,12 +509,16 @@ class IMAPRepository(BaseRepository):
def cmp2key(mycmp):
"""Converts a cmp= function into a key= function
We need to keep cmp functions for backward compatibility"""
class K(object):
def __init__(self, obj, *args):
self.obj = obj
def __cmp__(self, other):
return mycmp(self.obj.getvisiblename(), other.obj.getvisiblename())
return K
retval.sort(key=cmp2key(self.foldersort))
self.folders = retval
@ -580,6 +584,7 @@ class IMAPRepository(BaseRepository):
finally:
self.imapserver.releaseconnection(imapobj)
class MappedIMAPRepository(IMAPRepository):
def getfoldertype(self):
return folder.UIDMaps.MappedIMAPFolder