added flask interface
This commit is contained in:
@@ -75,9 +75,7 @@ class Mail(Base):
|
||||
from_array=[]
|
||||
# print "Status"
|
||||
# print env
|
||||
if env.to is None:
|
||||
print self.id
|
||||
else:
|
||||
if not env.to is None:
|
||||
for t in env.to:
|
||||
a={"host": t.host, "mail": t.mailbox}
|
||||
to_array.append(a)
|
||||
@@ -121,6 +119,8 @@ class Mail(Base):
|
||||
if p.get_content_subtype()=="html":
|
||||
|
||||
b4=bs4.BeautifulSoup(pl,"html.parser")
|
||||
[s.extract() for s in b4('script')]
|
||||
[s.extract() for s in b4('style')]
|
||||
self.text= yaml.dump(b4.get_text())
|
||||
else:
|
||||
self.text =yaml.dump( pl)
|
||||
|
||||
Reference in New Issue
Block a user