Warn on missing information and skipping entries
This commit is contained in:
parent
ea7c9f2319
commit
084bb5307e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user