refactor1
This commit is contained in:
@@ -105,6 +105,14 @@ class MailThread(Base):
|
||||
db_session.commit()
|
||||
self.date=self.mails()[0].date
|
||||
|
||||
def print_mail(self, filter="all"):
|
||||
a=[]
|
||||
if filter=="all":
|
||||
mm=self.mails()
|
||||
for m in mm:
|
||||
a.append((m.print_head(), m.print_text()))
|
||||
return a
|
||||
|
||||
def print_text(self,filter="all"):
|
||||
a=[]
|
||||
if filter=="all":
|
||||
@@ -114,6 +122,16 @@ class MailThread(Base):
|
||||
elif filter=="first":
|
||||
a.append(m[0].print_text())
|
||||
return a
|
||||
def print_head(self,filter="all"):
|
||||
a=[]
|
||||
if filter=="all":
|
||||
mm=self.mails()
|
||||
for m in mm:
|
||||
a.append(m.print_head())
|
||||
elif filter=="first":
|
||||
a.append(m[0].print_head())
|
||||
return a
|
||||
|
||||
def text(self,filter="all"):
|
||||
a=u""
|
||||
def mail_txt(m):
|
||||
|
||||
Reference in New Issue
Block a user