Reformat offlineimap/imapserver.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:19:23 +02:00
parent 20a9837e26
commit b6a686e56f

View File

@ -34,9 +34,9 @@ import offlineimap.accounts
from offlineimap import imaplibutil, imaputil, threadutil, OfflineImapError from offlineimap import imaplibutil, imaputil, threadutil, OfflineImapError
from offlineimap.ui import getglobalui from offlineimap.ui import getglobalui
try: try:
import gssapi import gssapi
have_gss = True have_gss = True
except ImportError: except ImportError:
have_gss = False have_gss = False
@ -333,22 +333,22 @@ class IMAPServer(object):
"TLS connection: %s" % str(e), "TLS connection: %s" % str(e),
OfflineImapError.ERROR.REPO, None, exc_info()[2]) OfflineImapError.ERROR.REPO, None, exc_info()[2])
## All __authn_* procedures are helpers that do authentication. # All __authn_* procedures are helpers that do authentication.
## They are class methods that take one parameter, IMAP object. # They are class methods that take one parameter, IMAP object.
## #
## Each function should return True if authentication was # Each function should return True if authentication was
## successful and False if authentication wasn't even tried # successful and False if authentication wasn't even tried
## for some reason (but not when IMAP has no such authentication # for some reason (but not when IMAP has no such authentication
## capability, calling code checks that). # capability, calling code checks that).
## #
## Functions can also raise exceptions; two types are special # Functions can also raise exceptions; two types are special
## and will be handled by the calling code: # and will be handled by the calling code:
## #
## - imapobj.error means that there was some error that # - imapobj.error means that there was some error that
## comes from imaplib2; # comes from imaplib2;
## #
## - OfflineImapError means that function detected some # - OfflineImapError means that function detected some
## problem by itself. # problem by itself.
def __authn_gssapi(self, imapobj): def __authn_gssapi(self, imapobj):
if not have_gss: if not have_gss:
@ -672,8 +672,7 @@ class IMAPServer(object):
six.reraise(OfflineImapError, six.reraise(OfflineImapError,
OfflineImapError( OfflineImapError(
"Could not connect to remote server '%s' " "Could not connect to remote server '%s' "
"for repository '%s'. Remote does not answer."% "for repository '%s'. Remote does not answer." % (self.hostname, self.repos),
(self.hostname, self.repos),
OfflineImapError.ERROR.REPO), OfflineImapError.ERROR.REPO),
exc_info()[2]) exc_info()[2])
else: else:
@ -751,7 +750,6 @@ class IMAPServer(object):
self.ui.debug('imap', 'keepalive: event is set; exiting') self.ui.debug('imap', 'keepalive: event is set; exiting')
return return
def releaseconnection(self, connection, drop_conn=False): def releaseconnection(self, connection, drop_conn=False):
"""Releases a connection, returning it to the pool. """Releases a connection, returning it to the pool.
@ -864,7 +862,6 @@ class IdleThread(object):
else: else:
self.parent.releaseconnection(imapobj) self.parent.releaseconnection(imapobj)
while not self.stop_sig.isSet(): while not self.stop_sig.isSet():
self.needsync = False self.needsync = False