no enclosures in text for daily digests

This commit is contained in:
Ronald Schaten 2013-04-17 20:59:50 +02:00
parent 57da07a193
commit e987dda3ca
2 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ def mail_daily_digest(session, sender, receiver, prefix):
link = entry.link
if entry.resolvedlink:
link = entry.resolvedlink
text = truncate_text(entry.get_text(), 250)
text = truncate_text(entry.get_text(enclosures=False), 250)
text = textwrap.fill(text, width=78)
try:
body += '=> %s - %s\n' % (entry.firstfetched.strftime('%Y-%m-%dT%H:%M'), feedinfo.title)
@ -70,8 +70,8 @@ def mail_daily_digest(session, sender, receiver, prefix):
if prefix != '':
subject = '%s %s' % (prefix, subject)
send_mail(sender, receiver, subject, body)
for feed, feedinfo, entry in entries:
entry.sent = datetime.now()
#for feed, feedinfo, entry in entries:
# entry.sent = datetime.now()
else:
print 'no unmailed digest-entries found... not sending mail.'

View File

@ -130,7 +130,7 @@ class Entry(Base):
def __repr__(self):
return "<Entry('%d','%s')>" % (self.id, self.title)
def get_text(self):
def get_text(self, enclosures=True):
text = ''
if self.feed.contentcolumn == 'summary' and self.summary:
text = self.summary
@ -140,7 +140,7 @@ class Entry(Base):
text = self.fullpage
elif self.feed.contentcolumn == 'readability' and self.readability:
text = self.readability
if self.enclosures:
if self.enclosures and enclosures:
text += '\n\nEnclosures:\n%s' % self.enclosures
return text