Add pushContent in feeds.py

Useful for twitter (later) for it's "clip" toggle, which keeps the original desc/content above the article. Makes changing the content, while keeping the original stub in place, easier.
This commit is contained in:
2013-09-25 12:18:22 +02:00
parent 208d70d3db
commit edff54a016
2 changed files with 12 additions and 19 deletions

View File

@@ -343,6 +343,15 @@ class FeedItem(FeedBase):
description = desc = FeedDescriptor('desc')
content = FeedDescriptor('content')
def pushContent(self, value, clip=False):
if not self.desc and self.content:
self.desc = self.content
if self.desc and clip:
self.content = self.desc + "<br/><br/>* * *<br/><br/>" + value
else:
self.content = value
def remove(self):
self.xml.getparent().remove(self.xml)