fix mails parsing (fix #637)
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
parent
1f571a9dc9
commit
31f01c2b4b
1 changed files with 4 additions and 3 deletions
|
|
@ -101,7 +101,8 @@ class MailParser(object):
|
||||||
self.title = 'Discussion with %s' % name
|
self.title = 'Discussion with %s' % name
|
||||||
self.sender = name
|
self.sender = name
|
||||||
self.name = name
|
self.name = name
|
||||||
self.tr = tr.childNodes[0].childNodes[1].childNodes[0].childNodes[0]
|
self.tr = tr.childNodes[0].childNodes[1].childNodes[1].childNodes[0]
|
||||||
|
|
||||||
self.new = False
|
self.new = False
|
||||||
|
|
||||||
tds = self.tr.childNodes
|
tds = self.tr.childNodes
|
||||||
|
|
@ -149,7 +150,7 @@ class MailParser(object):
|
||||||
def parse_date(self, date_str):
|
def parse_date(self, date_str):
|
||||||
# To match regexp, we have to remove any return chars in string
|
# To match regexp, we have to remove any return chars in string
|
||||||
# before the status ('nouveau', 'lu', etc)
|
# before the status ('nouveau', 'lu', etc)
|
||||||
date_str = u''.join(date_str.split(u'\n'))
|
date_str = date_str.strip()
|
||||||
|
|
||||||
m = self.DATETIME_REGEXP.match(date_str)
|
m = self.DATETIME_REGEXP.match(date_str)
|
||||||
if m:
|
if m:
|
||||||
|
|
@ -303,7 +304,7 @@ class ContactThreadPage(PageBase):
|
||||||
for big in big_list:
|
for big in big_list:
|
||||||
for child in big.childNodes:
|
for child in big.childNodes:
|
||||||
if hasattr(child, 'tagName') and child.tagName == u'b':
|
if hasattr(child, 'tagName') and child.tagName == u'b':
|
||||||
self.name = child.childNodes[1].data.strip()
|
self.name = child.childNodes[0].data.strip()
|
||||||
break
|
break
|
||||||
|
|
||||||
tables = self.document.getElementsByTagName('table')
|
tables = self.document.getElementsByTagName('table')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue