Guénaël Muller пре 6 година
родитељ
комит
5516f745bc

+ 1 - 1
tracim/tracim/config/app_cfg.py Прегледај датотеку

@@ -128,7 +128,7 @@ def start_daemons(manager: DaemonsManager):
128 128
         manager.run('mail_sender', MailSenderDaemon)
129 129
 
130 130
     if cfg.EMAIL_REPLY_ACTIVATED:
131
-        manager.run('mail_fetcher',MailFetcherDaemon)
131
+        manager.run('mail_fetcher', MailFetcherDaemon)
132 132
 
133 133
 
134 134
 def configure_depot():

+ 4 - 1
tracim/tracim/lib/email_processing/models.py Прегледај датотеку

@@ -1,6 +1,8 @@
1 1
 from bs4 import BeautifulSoup
2 2
 
3 3
 # -*- coding: utf-8 -*-
4
+
5
+
4 6
 class BodyMailPartType(object):
5 7
     Signature = 'sign'
6 8
     Main = 'main'
@@ -98,6 +100,7 @@ class BodyMailParts(object):
98 100
             s_mail += elem.text
99 101
         return str(s_mail)
100 102
 
103
+
101 104
 class HtmlBodyMailParts(BodyMailParts):
102 105
 
103 106
     def append(self, value):
@@ -109,4 +112,4 @@ class HtmlBodyMailParts(BodyMailParts):
109 112
             if not txt:
110 113
                 value.part_type = self._list[-1].part_type
111 114
         BodyMailParts._check_value(value)
112
-        BodyMailParts._append(self,value)
115
+        BodyMailParts._append(self, value)

+ 5 - 3
tracim/tracim/lib/email_processing/parser.py Прегледај датотеку

@@ -1,7 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 from bs4 import BeautifulSoup
3
-from bs4 import NavigableString
4
-from bs4 import Tag
5 3
 
6 4
 from tracim.lib.email_processing.checkers import ProprietaryHTMLAttrValues
7 5
 from tracim.lib.email_processing.checkers import HtmlMailQuoteChecker
@@ -10,6 +8,7 @@ from tracim.lib.email_processing.models import BodyMailPartType
10 8
 from tracim.lib.email_processing.models import BodyMailPart
11 9
 from tracim.lib.email_processing.models import HtmlBodyMailParts
12 10
 
11
+
13 12
 class PreSanitizeConfig(object):
14 13
     """
15 14
     To avoid problems, html need to be sanitize a bit during parsing to distinct
@@ -88,7 +87,10 @@ class ParsedHTMLMail(object):
88 87
         return parts
89 88
 
90 89
     @classmethod
91
-    def _process_elements(cls, elements: HtmlBodyMailParts) -> HtmlBodyMailParts:
90
+    def _process_elements(
91
+            cls,
92
+            elements: HtmlBodyMailParts,
93
+    ) -> HtmlBodyMailParts:
92 94
         if len(elements) >= 2:
93 95
             # Case 1 and 2, only one main and one quote
94 96
             if elements.get_nb_part_type('main') == 1 and \