Small fixe of the "rssid" method usage (updated)
Sorry, I did a little mistake. Signed-off-by: Florent <weboob@flo.fourcot.fr> Signed-off-by: Romain Bignon <romain@symlink.me>
This commit is contained in:
parent
c172a1b1af
commit
a195a5e9c8
2 changed files with 5 additions and 5 deletions
|
|
@ -72,7 +72,7 @@ class GenericNewspaperBackend(BaseBackend, ICapMessages):
|
||||||
return thread
|
return thread
|
||||||
|
|
||||||
def iter_threads(self):
|
def iter_threads(self):
|
||||||
for article in Newsfeed(self.RSS_FEED, GenericNewspaperBackend.RSSID).iter_entries():
|
for article in Newsfeed(self.RSS_FEED, self.RSSID).iter_entries():
|
||||||
thread = Thread(article.id)
|
thread = Thread(article.id)
|
||||||
thread.title = article.title
|
thread.title = article.title
|
||||||
thread.date = article.datetime
|
thread.date = article.datetime
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,10 @@ __all__ = ['Entry', 'Newsfeed']
|
||||||
|
|
||||||
class Entry:
|
class Entry:
|
||||||
def __init__(self, entry, rssid_func=None):
|
def __init__(self, entry, rssid_func=None):
|
||||||
self.id = entry.id
|
if rssid_func:
|
||||||
|
self.id = rssid_func(entry)
|
||||||
|
else:
|
||||||
|
self.id = entry.id
|
||||||
|
|
||||||
if entry.has_key("link"):
|
if entry.has_key("link"):
|
||||||
self.link = entry["link"]
|
self.link = entry["link"]
|
||||||
|
|
@ -65,9 +68,6 @@ class Entry:
|
||||||
elif self.summary:
|
elif self.summary:
|
||||||
self.content.append(self.summary)
|
self.content.append(self.summary)
|
||||||
|
|
||||||
if rssid_func:
|
|
||||||
self.id = rssid_func(self)
|
|
||||||
|
|
||||||
class Newsfeed:
|
class Newsfeed:
|
||||||
def __init__(self, url, rssid_func=None):
|
def __init__(self, url, rssid_func=None):
|
||||||
self.feed = feedparser.parse(url)
|
self.feed = feedparser.parse(url)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue