no enclosures in text for daily digests
This commit is contained in:
		@@ -51,7 +51,7 @@ def mail_daily_digest(session, sender, receiver, prefix):
 | 
				
			|||||||
        link = entry.link
 | 
					        link = entry.link
 | 
				
			||||||
        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(enclosures=False), 250)
 | 
				
			||||||
        text = textwrap.fill(text, width=78)
 | 
					        text = textwrap.fill(text, width=78)
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            body += '=> %s - %s\n' % (entry.firstfetched.strftime('%Y-%m-%dT%H:%M'), feedinfo.title)
 | 
					            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 != '':
 | 
					        if prefix != '':
 | 
				
			||||||
            subject = '%s %s' % (prefix, subject)
 | 
					            subject = '%s %s' % (prefix, subject)
 | 
				
			||||||
        send_mail(sender, receiver, subject, body)
 | 
					        send_mail(sender, receiver, subject, body)
 | 
				
			||||||
        for feed, feedinfo, entry in entries:
 | 
					        #for feed, feedinfo, entry in entries:
 | 
				
			||||||
            entry.sent = datetime.now()
 | 
					        #    entry.sent = datetime.now()
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        print 'no unmailed digest-entries found... not sending mail.'
 | 
					        print 'no unmailed digest-entries found... not sending mail.'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -130,7 +130,7 @@ class Entry(Base):
 | 
				
			|||||||
    def __repr__(self):
 | 
					    def __repr__(self):
 | 
				
			||||||
       return "<Entry('%d','%s')>" % (self.id, self.title)
 | 
					       return "<Entry('%d','%s')>" % (self.id, self.title)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_text(self):
 | 
					    def get_text(self, enclosures=True):
 | 
				
			||||||
        text = ''
 | 
					        text = ''
 | 
				
			||||||
        if self.feed.contentcolumn == 'summary' and self.summary:
 | 
					        if self.feed.contentcolumn == 'summary' and self.summary:
 | 
				
			||||||
            text = self.summary
 | 
					            text = self.summary
 | 
				
			||||||
@@ -140,7 +140,7 @@ class Entry(Base):
 | 
				
			|||||||
            text = self.fullpage
 | 
					            text = self.fullpage
 | 
				
			||||||
        elif self.feed.contentcolumn == 'readability' and self.readability:
 | 
					        elif self.feed.contentcolumn == 'readability' and self.readability:
 | 
				
			||||||
            text = self.readability
 | 
					            text = self.readability
 | 
				
			||||||
        if self.enclosures:
 | 
					        if self.enclosures and enclosures:
 | 
				
			||||||
            text += '\n\nEnclosures:\n%s' % self.enclosures
 | 
					            text += '\n\nEnclosures:\n%s' % self.enclosures
 | 
				
			||||||
        return text
 | 
					        return text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user