comparison backend/AbstractFeedUpdater.py @ 144:74217db92993

updating feeds on the couchdb backend works now
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 24 Aug 2011 11:54:06 +0200
parents 6ea813cfac33
children 86f828096aaf
comparison
equal deleted inserted replaced
143:f0941f42314c 144:74217db92993
19 log.info("updating " + self.feed.rss_url) 19 log.info("updating " + self.feed.rss_url)
20 result = self._retrieveFeed() 20 result = self._retrieveFeed()
21 for entry in result.entries: 21 for entry in result.entries:
22 self._normalize(entry) 22 self._normalize(entry)
23 self._processEntry(entry) 23 self._processEntry(entry)
24 self.feed.incrementNextUpdateDate() 24 self._incrementFeedUpdateDate()
25 25
26 def _retrieveFeed(self): 26 def _retrieveFeed(self):
27 result = feedparser.parse(self.feed.rss_url) 27 result = feedparser.parse(self.feed.rss_url)
28 # bozo flags if a feed is well-formed. 28 # bozo flags if a feed is well-formed.
29 # if result["bozo"] > 0: 29 # if result["bozo"] > 0:
47 entry.summary = "" 47 entry.summary = ""
48 48
49 def _processEntry(self, entry): 49 def _processEntry(self, entry):
50 raise Exception("_processEntry is abstract, subclasses must override") 50 raise Exception("_processEntry is abstract, subclasses must override")
51 51
52 def _incrementFeedUpdateDate(self):
53 raise Exception("_incrementNextUpdateDate is abstract, subclasses must override")
54
52 55
53 class FeedUpdateException(Exception): 56 class FeedUpdateException(Exception):
54 pass 57 pass