Allow one to subscribe to planet feeds
This commit is contained in:
parent
9d7627781c
commit
6f7eddf0f0
@ -262,10 +262,12 @@ def reconstitute(feed, entry):
|
||||
# merge in planet:* from feed (or simply use the feed if no source)
|
||||
src = entry.get('source')
|
||||
if src:
|
||||
for name,value in feed.feed.items():
|
||||
if name.startswith('planet_'): src[name]=value
|
||||
for name,value in feed.feed.items():
|
||||
if name.startswith('planet_'): src[name]=value
|
||||
if feed.feed.has_key('id'):
|
||||
src['planet_id'] = feed.feed.id
|
||||
else:
|
||||
src = feed.feed
|
||||
src = feed.feed
|
||||
|
||||
# source:author
|
||||
src_author = src.get('author_detail',{})
|
||||
|
@ -81,7 +81,9 @@ def splice():
|
||||
if sources:
|
||||
ids = sources[0].getElementsByTagName('id')
|
||||
if ids and ids[0].childNodes[0].nodeValue not in sub_ids:
|
||||
continue
|
||||
ids = sources[0].getElementsByTagName('planet_id')
|
||||
if not ids: continue
|
||||
if ids[0].childNodes[0].nodeValue not in sub_ids: continue
|
||||
|
||||
# add entry to feed
|
||||
feed.appendChild(entry.documentElement)
|
||||
|
14
tests/data/reconstitute/source_planet_id.xml
Normal file
14
tests/data/reconstitute/source_planet_id.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<!--
|
||||
Description: source id
|
||||
Expect: source.planet_id == 'http://example.com/'
|
||||
-->
|
||||
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<id>http://example.com/</id>
|
||||
<entry>
|
||||
<source>
|
||||
<id>http://example.org/</id>
|
||||
</source>
|
||||
</entry>
|
||||
</feed>
|
||||
|
Loading…
Reference in New Issue
Block a user