Reformat offlineimap/imaplibutil.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 20:17:18 +02:00
parent ba9a3ce819
commit 20a9837e26

View File

@ -57,15 +57,15 @@ class UsefulIMAPMixIn(object):
raise raise
except self.abort as e: except self.abort as e:
# self.abort is raised when we are supposed to retry # self.abort is raised when we are supposed to retry
errstr = "Server '%s' closed connection, error on SELECT '%s'. Ser"\ errstr = "Server '%s' closed connection, error on SELECT '%s'. Ser" \
"ver said: %s" % (self.host, mailbox, e.args[0]) "ver said: %s" % (self.host, mailbox, e.args[0])
severity = OfflineImapError.ERROR.FOLDER_RETRY severity = OfflineImapError.ERROR.FOLDER_RETRY
six.reraise(OfflineImapError, six.reraise(OfflineImapError,
OfflineImapError(errstr, severity), OfflineImapError(errstr, severity),
exc_info()[2]) exc_info()[2])
if result[0] != 'OK': if result[0] != 'OK':
#in case of error, bail out with OfflineImapError # in case of error, bail out with OfflineImapError
errstr = "Error SELECTing mailbox '%s', server reply:\n%s" %\ errstr = "Error SELECTing mailbox '%s', server reply:\n%s" % \
(mailbox, result) (mailbox, result)
severity = OfflineImapError.ERROR.FOLDER severity = OfflineImapError.ERROR.FOLDER
raise OfflineImapError(errstr, severity) raise OfflineImapError(errstr, severity)
@ -181,7 +181,7 @@ def new_mesg(self, s, tn=None, secs=None):
if tn is None: if tn is None:
tn = threading.currentThread().getName() tn = threading.currentThread().getName()
tm = time.strftime('%M:%S', time.localtime(secs)) tm = time.strftime('%M:%S', time.localtime(secs))
getglobalui().debug('imap', ' %s.%02d %s %s' % (tm, (secs*100)%100, tn, s)) getglobalui().debug('imap', ' %s.%02d %s %s' % (tm, (secs * 100) % 100, tn, s))
class WrappedIMAP4_SSL(UsefulIMAPMixIn, IMAP4_SSL): class WrappedIMAP4_SSL(UsefulIMAPMixIn, IMAP4_SSL):
@ -219,8 +219,9 @@ class WrappedIMAP4_SSL(UsefulIMAPMixIn, IMAP4_SSL):
"for hostname '%s' " "for hostname '%s' "
"does not match configured fingerprint(s) %s. " "does not match configured fingerprint(s) %s. "
"Please verify and set 'cert_fingerprint' accordingly " "Please verify and set 'cert_fingerprint' accordingly "
"if not set yet."% "if not set yet." %
(list(zip([hash.__name__ for hash in hashes], server_fingerprints)), host, self._fingerprint), (list(zip([hash.__name__ for hash in hashes], server_fingerprints)), host,
self._fingerprint),
OfflineImapError.ERROR.REPO) OfflineImapError.ERROR.REPO)
@ -264,7 +265,7 @@ def Internaldate2epoch(resp):
# INTERNALDATE timezone must be subtracted to get UT # INTERNALDATE timezone must be subtracted to get UT
zone = (zoneh*60 + zonem)*60 zone = (zoneh * 60 + zonem) * 60
if zonen == '-': if zonen == '-':
zone = -zone zone = -zone