[weboob] [PATCH 1/1] Small fixe of the "rssid" method usage (updated)

Florent weboob at flo.fourcot.fr
Fri Feb 17 15:44:14 CET 2012


Sorry, I did a little mistake. 

Signed-off-by: Florent <weboob at flo.fourcot.fr>
---
 .../tools/capabilities/messages/GenericBackend.py  |    2 +-
 weboob/tools/newsfeed.py                           |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/weboob/tools/capabilities/messages/GenericBackend.py b/weboob/tools/capabilities/messages/GenericBackend.py
index 82e7fe9..0c205d1 100644
--- a/weboob/tools/capabilities/messages/GenericBackend.py
+++ b/weboob/tools/capabilities/messages/GenericBackend.py
@@ -72,7 +72,7 @@ class GenericNewspaperBackend(BaseBackend, ICapMessages):
         return thread
 
     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.title =  article.title
             thread.date = article.datetime
diff --git a/weboob/tools/newsfeed.py b/weboob/tools/newsfeed.py
index 6a9f7a6..2641dbb 100644
--- a/weboob/tools/newsfeed.py
+++ b/weboob/tools/newsfeed.py
@@ -31,7 +31,10 @@ __all__ = ['Entry', 'Newsfeed']
 
 class Entry:
     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"):
             self.link = entry["link"]
@@ -65,9 +68,6 @@ class Entry:
         elif self.summary:
             self.content.append(self.summary)
 
-        if rssid_func:
-            self.id = rssid_func(self)
-
 class Newsfeed:
     def __init__(self, url, rssid_func=None):
         self.feed = feedparser.parse(url)
-- 
1.7.2.5




More information about the weboob mailing list