refactor1

This commit is contained in:
Andreas Stephanides
2017-08-28 09:08:47 +02:00
parent 699f4f6546
commit 630b982502
14 changed files with 274 additions and 230 deletions

View File

@@ -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):