• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

news4 - RSS aggrigation system


Commit MetaInfo

修订版32bf686b742747550815da3f22823db8d90a2fb1 (tree)
时间2012-12-04 13:23:06
作者hylom <hylom@user...>
Commiterhylom

Log Message

temporary fix: error ocurred when RSS's description is not exist

更改概述

差异

--- a/fetcher.py
+++ b/fetcher.py
@@ -18,11 +18,15 @@ class FeedFetcher(object):
1818 f = feedparser.parse(self._feed["source"])
1919 entries = []
2020 for e in f['entries']:
21+ try:
22+ desc = e.description
23+ except AttributeError:
24+ desc = ''
2125 entry = {
2226 # 'title': e.title.decode('utf8') if isinstance(e.title, str) else e.title,
2327 'title': e.title,
2428 'url': e.link,
25- 'body': e.description,
29+ 'body': desc,
2630 'date': dateutil.parser.parse(e.updated),
2731 'feed': self._feed,
2832 'tags': [],