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:43:09 +02:00
parent 2f97dda6d9
commit da1788db53

View File

@ -27,7 +27,6 @@ from offlineimap import imaputil, imaplibutil, emailutil, OfflineImapError
from offlineimap import globals from offlineimap import globals
from offlineimap.virtual_imaplib2 import MonthNames from offlineimap.virtual_imaplib2 import MonthNames
# Globals # Globals
CRLF = '\r\n' CRLF = '\r\n'
MSGCOPY_NAMESPACE = 'MSGCOPY_' MSGCOPY_NAMESPACE = 'MSGCOPY_'
@ -263,7 +262,6 @@ class IMAPFolder(BaseFolder):
def msglist_item_initializer(self, uid): def msglist_item_initializer(self, uid):
return {'uid': uid, 'flags': set(), 'time': 0} return {'uid': uid, 'flags': set(), 'time': 0}
# Interface from BaseFolder # Interface from BaseFolder
def cachemessagelist(self, min_date=None, min_uid=None): def cachemessagelist(self, min_date=None, min_uid=None):
self.ui.loadmessagelist(self.repository, self) self.ui.loadmessagelist(self.repository, self)
@ -286,7 +284,8 @@ class IMAPFolder(BaseFolder):
if res_type != 'OK': if res_type != 'OK':
raise OfflineImapError("FETCHING UIDs in folder [%s]%s failed. " raise OfflineImapError("FETCHING UIDs in folder [%s]%s failed. "
"Server responded '[%s] %s'" % (self.getrepository(), self, "Server responded '[%s] %s'" % (self.getrepository(), self,
res_type, response), OfflineImapError.ERROR.FOLDER) res_type, response),
OfflineImapError.ERROR.FOLDER)
finally: finally:
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)
@ -378,7 +377,6 @@ class IMAPFolder(BaseFolder):
headervalue += str(self.randomgenerator.randint(0, 9999999999)) headervalue += str(self.randomgenerator.randint(0, 9999999999))
return (headername, headervalue) return (headername, headervalue)
def __savemessage_searchforheader(self, imapobj, headername, headervalue): def __savemessage_searchforheader(self, imapobj, headername, headervalue):
self.ui.debug('imap', '__savemessage_searchforheader called for %s: %s' % self.ui.debug('imap', '__savemessage_searchforheader called for %s: %s' %
(headername, headervalue)) (headername, headervalue))
@ -765,7 +763,6 @@ class IMAPFolder(BaseFolder):
self.ui.debug('imap', 'savemessage: returning new UID %d' % uid) self.ui.debug('imap', 'savemessage: returning new UID %d' % uid)
return uid return uid
def _fetch_from_imap(self, uids, retry_num=1): def _fetch_from_imap(self, uids, retry_num=1):
"""Fetches data from IMAP server. """Fetches data from IMAP server.
@ -836,7 +833,6 @@ class IMAPFolder(BaseFolder):
return ndata return ndata
def _store_to_imap(self, imapobj, uid, field, data): def _store_to_imap(self, imapobj, uid, field, data):
"""Stores data to IMAP server """Stores data to IMAP server
@ -947,7 +943,6 @@ class IMAPFolder(BaseFolder):
elif operation == '-': elif operation == '-':
self.messagelist[uid]['flags'] -= flags self.messagelist[uid]['flags'] -= flags
def __processmessagesflags(self, operation, uidlist, flags): def __processmessagesflags(self, operation, uidlist, flags):
# Hack for those IMAP servers with a limited line length. # Hack for those IMAP servers with a limited line length.
batch_size = 100 batch_size = 100
@ -956,7 +951,6 @@ class IMAPFolder(BaseFolder):
uidlist[i:i + batch_size], flags) uidlist[i:i + batch_size], flags)
return return
# Interface from BaseFolder # Interface from BaseFolder
def change_message_uid(self, uid, new_uid): def change_message_uid(self, uid, new_uid):
"""Change the message from existing uid to new_uid """Change the message from existing uid to new_uid