From 9bd73462612b1f440f4e21530f95fc110e151132 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 23 Mar 2012 12:01:45 +0100 Subject: [PATCH] Revert "Don't get page with 0 comment" This reverts commit 4a5456b152f4e6c018fce2f0fb100bce02d80a54. This commit was here to bypass a bug of dlfp rss Atom. The bug is fixed and the commit can be reverted. Reference : http://linuxfr.org/suivi/855 --- modules/dlfp/backend.py | 2 +- modules/dlfp/browser.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/dlfp/backend.py b/modules/dlfp/backend.py index 0c57014e..ebb043e0 100644 --- a/modules/dlfp/backend.py +++ b/modules/dlfp/backend.py @@ -101,7 +101,7 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapContent): # Check if we have seen all comments of this thread. oldhash = self.storage.get('hash', id, default="") newhash = self.browser.get_hash(thread._rsscomment) - if not getseen and (oldhash == newhash or newhash is None): + if not getseen and oldhash == newhash: return None self.storage.set('hash', id, newhash) self.storage.save() diff --git a/modules/dlfp/browser.py b/modules/dlfp/browser.py index 0f0160d8..9e55900f 100644 --- a/modules/dlfp/browser.py +++ b/modules/dlfp/browser.py @@ -133,10 +133,8 @@ class DLFP(BaseBrowser): def get_hash(self, url): self.location(url) - if self.page.document.xpath('//entry'): - return hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest() - else: - return None + myhash = hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest() + return myhash def get_content(self, _id): url, _id = self.parse_id(_id)