Browse Source

Comment + PEP8

Guénaël Muller 7 years ago
parent
commit
370dad7f8c
1 changed files with 3 additions and 4 deletions
  1. 3 4
      tracim/tracim/lib/email_fetcher.py

+ 3 - 4
tracim/tracim/lib/email_fetcher.py View File

@@ -22,7 +22,7 @@ from tracim.controllers.events import VALID_TOKEN_VALUE
22 22
 TRACIM_SPECIAL_KEY_HEADER = "X-Tracim-Key"
23 23
 BS_HTML_BODY_PARSE_CONFIG = {
24 24
     'tag_blacklist': ["script", "style", "blockquote"],
25
-    'class_blacklist': ['moz-cite-prefix','gmail_extra','gmail_quote',
25
+    'class_blacklist': ['moz-cite-prefix', 'gmail_extra', 'gmail_quote',
26 26
                         'yahoo_quoted'],
27 27
     'id_blacklist': ['reply-intro'],
28 28
     'tag_whitelist': ['a', 'b', 'strong', 'i', 'br', 'ul', 'li', 'ol',
@@ -111,7 +111,6 @@ class DecodedMail(object):
111 111
     def _get_mime_body_message(self) -> typing.Optional[Message]:
112 112
         # FIXME - G.M - 2017-11-16 - Use stdlib msg.get_body feature for py3.6+
113 113
         # FIXME - G.M - 2017-11-16 - Check support for non-multipart mail
114
-        # assert msg.is_multipart()
115 114
         part = None
116 115
         # Check for html
117 116
         for part in self._message.walk():
@@ -119,7 +118,7 @@ class DecodedMail(object):
119 118
             cdispo = str(part.get('Content-Disposition'))
120 119
             if ctype == 'text/html' and 'attachment' not in cdispo:
121 120
                 return part
122
-        # checj fir plain text
121
+        # check for plain text
123 122
         for part in self._message.walk():
124 123
             ctype = part.get_content_type()
125 124
             cdispo = str(part.get('Content-Disposition'))
@@ -270,7 +269,7 @@ class MailFetcher(object):
270 269
             try:
271 270
                 r = requests.post(self.endpoint, json=msg)
272 271
                 response = r.json()
273
-                if not 'status' in response:
272
+                if 'status' not in response:
274 273
                     log = 'bad response: {}'
275 274
                     logger.error(self, log.format(str(response)))
276 275
                 else: