minor modifications

This commit is contained in:
Ronald Schaten 2013-04-05 23:42:29 +02:00
parent 6145a040d2
commit 640442b95d

View File

@ -56,12 +56,12 @@ def mail_daily_digest(session, sender, receiver, prefix):
if entry.resolvedlink:
link = entry.resolvedlink
text = truncate_text(entry.get_text(), 250)
text = textwrap.fill(text, 78)
text = textwrap.fill(text, width=78)
try:
body = body + '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title)
body = body + '>> %s\n' % entry.title
body = body + '%s\n' % text
body = body + '%s\n\n' % link
body += '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title)
body += '>> %s\n' % entry.title
body += '%s\n' % text
body += '%s\n\n' % link
except:
print 'ERROR processing entry %s' % entry.id;
print sys.exc_info()
@ -86,9 +86,9 @@ def mail_single_entry(feed, feedinfo, entry, sender, receiver, prefix):
link = entry.link
if entry.resolvedlink:
link = entry.resolvedlink
body = '%s\n\n' % entry.get_text()
body = body + '%s\n' % feedinfo.link
body = body + '%s\n' % link
body = entry.get_text()
#body = '\n'.join(textwrap.wrap(body, width=78, break_long_words=False, replace_whitespace=False, break_on_hyphens=False))
body += '\n\n%s\n%s\n' % (feedinfo.link, link)
sender[0] = feedinfo.title
send_mail(sender, receiver, subject, body)
entry.sent = datetime.now()