summaryrefslogtreecommitdiff
path: root/alot/db
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2015-12-16 16:49:39 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2015-12-16 16:49:39 +0000
commita82ae2019b9cf13968c2189d6ac99270f2d639fd (patch)
treed184e86e9b6f74d178f526d6b184017d186999cf /alot/db
parent539c5e7d46d2492a89a1b4f93a6e3b5e08a47db7 (diff)
pep8 fixes
Diffstat (limited to 'alot/db')
-rw-r--r--alot/db/attachment.py3
-rw-r--r--alot/db/envelope.py8
-rw-r--r--alot/db/message.py5
-rw-r--r--alot/db/thread.py5
-rw-r--r--alot/db/utils.py5
5 files changed, 15 insertions, 11 deletions
diff --git a/alot/db/attachment.py b/alot/db/attachment.py
index 5c958e0b..85358037 100644
--- a/alot/db/attachment.py
+++ b/alot/db/attachment.py
@@ -6,12 +6,13 @@ import tempfile
import email.charset as charset
from email.header import Header
from copy import deepcopy
-charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
import alot.helper as helper
from alot.helper import string_decode
from alot.db.utils import decode_header
+charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
+
class Attachment(object):
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 6550baeb..4abbdf7a 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -5,8 +5,6 @@ import os
import email
import re
import glob
-import email.charset as charset
-charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
from email.encoders import encode_7or8bit
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
@@ -23,6 +21,9 @@ from alot.errors import GPGProblem, GPGCode
from .attachment import Attachment
from .utils import encode_header
+import email.charset as charset
+charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
+
class Envelope(object):
@@ -210,8 +211,7 @@ class Envelope(object):
micalg = crypto.RFC3156_micalg_from_algo(signatures[0].hash_algo)
unencrypted_msg = MIMEMultipart('signed', micalg=micalg,
- protocol=
- 'application/pgp-signature')
+ protocol='application/pgp-signature')
# wrap signature in MIMEcontainter
stype = 'pgp-signature; name="signature.asc"'
diff --git a/alot/db/message.py b/alot/db/message.py
index 4249f8c8..c94d355b 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -3,8 +3,6 @@
# For further details see the COPYING file
import email
from datetime import datetime
-import email.charset as charset
-charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
from notmuch import NullPointerError
import alot.helper as helper
@@ -14,6 +12,9 @@ from .utils import extract_headers, extract_body, message_from_file
from alot.db.utils import decode_header
from .attachment import Attachment
+import email.charset as charset
+charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
+
class Message(object):
diff --git a/alot/db/thread.py b/alot/db/thread.py
index a0df09f1..8bb94a10 100644
--- a/alot/db/thread.py
+++ b/alot/db/thread.py
@@ -39,7 +39,8 @@ class Thread(object):
subject = thread.get_subject()
elif subject_type == 'oldest':
try:
- subject = list(thread.get_toplevel_messages())[0].get_header('subject')
+ first_msg = list(thread.get_toplevel_messages())[0]
+ subject = first_msg.get_header('subject')
except IndexError:
subject = ''
self._subject = subject
@@ -186,7 +187,7 @@ class Thread(object):
aname = settings.get('thread_authors_me')
if not aname:
aname = aaddress
- if not aname in authorslist:
+ if aname not in authorslist:
authorslist.append(aname)
return ', '.join(authorslist)
else:
diff --git a/alot/db/utils.py b/alot/db/utils.py
index 5250577c..63bd6b89 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -6,8 +6,6 @@ import email
import tempfile
import re
from email.header import Header
-import email.charset as charset
-charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
from email.iterators import typed_subpart_iterator
import logging
import mailcap
@@ -22,6 +20,9 @@ from alot.helper import string_decode
from alot.helper import parse_mailcap_nametemplate
from alot.helper import split_commandstring
+import email.charset as charset
+charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
+
X_SIGNATURE_VALID_HEADER = 'X-Alot-OpenPGP-Signature-Valid'
X_SIGNATURE_MESSAGE_HEADER = 'X-Alot-OpenPGP-Signature-Message'