Guénaël Muller 7 years ago
parent
commit
5516f745bc

+ 1 - 1
tracim/tracim/config/app_cfg.py View File

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

+ 4 - 1
tracim/tracim/lib/email_processing/models.py View File

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

+ 5 - 3
tracim/tracim/lib/email_processing/parser.py View File

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