IMAP.py long lines style

This patch changes long lines (>80 chars) to lines <80 chars.
The patch only changes the style.
This commit is contained in:
Rodolfo García Peñas (kix) 2020-10-31 16:14:53 +01:00
parent 1ce229ca9d
commit 332a6d7240

View File

@ -199,7 +199,8 @@ class IMAPRepository(BaseRepository):
return netrcentry[0] return netrcentry[0]
try: try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost()) netrcentry = netrc.netrc('/etc/netrc')\
.authenticators(self.gethost())
except IOError as inst: except IOError as inst:
if inst.errno not in (errno.ENOENT, errno.EACCES): if inst.errno not in (errno.ENOENT, errno.EACCES):
raise raise
@ -293,7 +294,8 @@ class IMAPRepository(BaseRepository):
comma-separated fingerprints in hex form.""" comma-separated fingerprints in hex form."""
value = self.getconf('cert_fingerprint', "") value = self.getconf('cert_fingerprint', "")
return [f.strip().lower().replace(":", "") for f in value.split(',') if f] return [f.strip().lower().replace(":", "")
for f in value.split(',') if f]
def setoauth2_request_url(self, url): def setoauth2_request_url(self, url):
self.oauth2_request_url = url self.oauth2_request_url = url
@ -416,7 +418,8 @@ class IMAPRepository(BaseRepository):
return netrcentry[2] return netrcentry[2]
# 5. Read password from /etc/netrc. # 5. Read password from /etc/netrc.
try: try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost()) netrcentry = netrc.netrc('/etc/netrc')\
.authenticators(self.gethost())
except IOError as inst: except IOError as inst:
if inst.errno not in (errno.ENOENT, errno.EACCES): if inst.errno not in (errno.ENOENT, errno.EACCES):
raise raise
@ -456,7 +459,8 @@ class IMAPRepository(BaseRepository):
listfunction = imapobj.lsub listfunction = imapobj.lsub
try: try:
result, listresult = listfunction(directory=self.imapserver.reference, pattern='"*"') result, listresult = \
listfunction(directory=self.imapserver.reference, pattern='"*"')
if result != 'OK': if result != 'OK':
raise OfflineImapError("Could not list the folders for" raise OfflineImapError("Could not list the folders for"
" repository %s. Server responded: %s" % " repository %s. Server responded: %s" %
@ -561,7 +565,8 @@ class IMAPRepository(BaseRepository):
return return
parts = foldername.split(self.getsep()) parts = foldername.split(self.getsep())
folder_paths = [self.getsep().join(parts[:n + 1]) for n in range(len(parts))] folder_paths = [self.getsep().join(parts[:n + 1])
for n in range(len(parts))]
for folder_path in folder_paths: for folder_path in folder_paths:
try: try:
self.makefolder_single(folder_path) self.makefolder_single(folder_path)