rewrite classifier
This commit is contained in:
@@ -32,6 +32,7 @@ class MailThread(Base):
|
||||
__jsonattrs__=None
|
||||
answered=False
|
||||
maintopic="information"
|
||||
lang=""
|
||||
def bdy(self):
|
||||
return yaml.load(self.body)
|
||||
|
||||
@@ -50,7 +51,7 @@ class MailThread(Base):
|
||||
|
||||
def tstr(self):
|
||||
fr=yaml.load(self.mails()[0].from_)
|
||||
return "(" + str(self.answered)+ ", "+ str(self.maintopic) + ") " + str(self.firstmail)+": "+str(fr[0]["mail"])+"@"+str(fr[0]["host"]) + " | ".join(yaml.load(self.mails()[0].subject))
|
||||
return "(" + str(self.answered)+ ", "+ str(self.maintopic)+ ", "+ str(self.lang) + ") " + str(self.firstmail)+": "+str(fr[0]["mail"])+"@"+str(fr[0]["host"]) + " | ".join(yaml.load(self.mails()[0].subject))
|
||||
|
||||
def mails(self):
|
||||
a=[]
|
||||
@@ -111,7 +112,7 @@ class MailThread(Base):
|
||||
elif filter=="first":
|
||||
a=mail_txt(m[0])
|
||||
a=re.sub(r'\n\s*\n',r'\n',a)
|
||||
a=re.sub(r'<!--.*-->',r'',a,flags=re.MULTILINE|re.DOTALL)
|
||||
# a=re.sub(r'<!--.*-->',r'',a,flags=re.MULTILINE|re.DOTALL)
|
||||
a=re.sub(r'\s*>+ .*\n',r'',a)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user