Mercurial > hg > Feedworm
comparison backend/AbstractFeedUpdater.py @ 187:2f2016a10f7d
handle a missing updated_parsed attribute in a feed entry gracefully
author | dirk |
---|---|
date | Tue, 13 Sep 2011 17:52:36 +0200 |
parents | a3c945ce434c |
children | e604c32f67aa |
comparison
equal
deleted
inserted
replaced
186:6cbd4420c187 | 187:2f2016a10f7d |
---|---|
46 self._incrementFeedUpdateDate() | 46 self._incrementFeedUpdateDate() |
47 | 47 |
48 def _normalize(self, entry): | 48 def _normalize(self, entry): |
49 if not hasattr(entry, "id"): | 49 if not hasattr(entry, "id"): |
50 entry.id = entry.link | 50 entry.id = entry.link |
51 if not hasattr(entry, "updated_parsed"): | 51 if not hasattr(entry, "updated_parsed") or entry.updated_parsed is None: |
52 # TODO try to parse the entry.updated date string | |
52 entry.updated_parsed = datetime.today() | 53 entry.updated_parsed = datetime.today() |
53 else: | 54 else: |
54 entry.updated_parsed = datetime(*entry.updated_parsed[:6]) | 55 entry.updated_parsed = datetime(*entry.updated_parsed[:6]) |
55 if not hasattr(entry, "summary"): | 56 if not hasattr(entry, "summary"): |
56 if hasattr(entry, "content"): | 57 if hasattr(entry, "content"): |