minor modifications
This commit is contained in:
parent
6145a040d2
commit
640442b95d
16
atomstrom.py
16
atomstrom.py
@ -56,12 +56,12 @@ def mail_daily_digest(session, sender, receiver, prefix):
|
|||||||
if entry.resolvedlink:
|
if entry.resolvedlink:
|
||||||
link = entry.resolvedlink
|
link = entry.resolvedlink
|
||||||
text = truncate_text(entry.get_text(), 250)
|
text = truncate_text(entry.get_text(), 250)
|
||||||
text = textwrap.fill(text, 78)
|
text = textwrap.fill(text, width=78)
|
||||||
try:
|
try:
|
||||||
body = body + '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title)
|
body += '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title)
|
||||||
body = body + '>> %s\n' % entry.title
|
body += '>> %s\n' % entry.title
|
||||||
body = body + '%s\n' % text
|
body += '%s\n' % text
|
||||||
body = body + '%s\n\n' % link
|
body += '%s\n\n' % link
|
||||||
except:
|
except:
|
||||||
print 'ERROR processing entry %s' % entry.id;
|
print 'ERROR processing entry %s' % entry.id;
|
||||||
print sys.exc_info()
|
print sys.exc_info()
|
||||||
@ -86,9 +86,9 @@ def mail_single_entry(feed, feedinfo, entry, sender, receiver, prefix):
|
|||||||
link = entry.link
|
link = entry.link
|
||||||
if entry.resolvedlink:
|
if entry.resolvedlink:
|
||||||
link = entry.resolvedlink
|
link = entry.resolvedlink
|
||||||
body = '%s\n\n' % entry.get_text()
|
body = entry.get_text()
|
||||||
body = body + '%s\n' % feedinfo.link
|
#body = '\n'.join(textwrap.wrap(body, width=78, break_long_words=False, replace_whitespace=False, break_on_hyphens=False))
|
||||||
body = body + '%s\n' % link
|
body += '\n\n%s\n%s\n' % (feedinfo.link, link)
|
||||||
sender[0] = feedinfo.title
|
sender[0] = feedinfo.title
|
||||||
send_mail(sender, receiver, subject, body)
|
send_mail(sender, receiver, subject, body)
|
||||||
entry.sent = datetime.now()
|
entry.sent = datetime.now()
|
||||||
|
Loading…
Reference in New Issue
Block a user