and the results are cached. ``poll`` then returns the contents of the
cache.
+ ``_poll`` may return None, in which case the cache will be left unchanged.
+
You must define a ``_cache_key`` method that returns a key uniquely
identifying this object. Your key will be combined with the class name, so
it only needs to be unique for that source, not globally.
return
updates = self._poll(self.limit, self.max_age)
- cache.get_cache('spline-frontpage')[self.cache_key()] = updates
+ if updates is not None:
+ cache.get_cache('spline-frontpage')[self.cache_key()] = updates
return
if feed.bozo and isinstance(feed.bozo_exception, URLError):
# Feed is DOWN. Bail here; otherwise, old entries might be lost
# just because, say, Bulbanews is down yet again
- raise feed.bozo_exception
+ return None
if not self.title:
self.title = feed.feed.title
len(entry.content[0].value) <= self.SUMMARY_LENGTH:
# Full content is short; use as-is!
- content = entry.entry.content[0].value
+ content = entry.content[0].value
elif 'content' in entry:
# Full content is way too much, especially for my giant blog posts.
# Cut this down to some arbitrary number of characters, then feed