From 084bb5307e446a49909bd02de744bc1d1a9da1c7 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Thu, 20 May 2010 15:10:36 -0400 Subject: [PATCH] Warn on missing information and skipping entries --- planet/splice.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/planet/splice.py b/planet/splice.py index 17cc86f..db3bd3b 100644 --- a/planet/splice.py +++ b/planet/splice.py @@ -58,6 +58,17 @@ def splice(): data=feedparser.parse(filename(sources,sub)) if data.feed.has_key('id'): sub_ids.append(data.feed.id) if not data.feed: continue + + for link in data.feed.links: + if link.rel == 'self': break + else: + log.warn('missing self link for ' + sub) + + for link in data.feed.links: + if link.rel == 'alternate' and 'html' in link.type: break + else: + log.warn('missing html link for ' + sub) + xdoc=minidom.parseString('''\n''' % planet.xmlns) reconstitute.source(xdoc.documentElement, data.feed, None, None) @@ -94,6 +105,8 @@ def splice(): ids = sources[0].getElementsByTagName('planet:id') if not ids: continue id = ids[0].childNodes[0].nodeValue + if id not in sub_ids: + log.warn('Skipping: ' + id) if id not in sub_ids: continue # add entry to feed