Permalink
Browse files

Warn on missing information and skipping entries

  • Loading branch information...
1 parent ea7c9f2 commit 084bb5307e446a49909bd02de744bc1d1a9da1c7 @rubys committed May 20, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 planet/splice.py
View
@@ -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('''<planet:source xmlns:planet="%s"
xmlns="http://www.w3.org/2005/Atom"/>\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

0 comments on commit 084bb53

Please sign in to comment.