Allow one to subscribe to planet feeds
This commit is contained in:
parent
9d7627781c
commit
6f7eddf0f0
@ -264,6 +264,8 @@ def reconstitute(feed, entry):
|
|||||||
if src:
|
if src:
|
||||||
for name,value in feed.feed.items():
|
for name,value in feed.feed.items():
|
||||||
if name.startswith('planet_'): src[name]=value
|
if name.startswith('planet_'): src[name]=value
|
||||||
|
if feed.feed.has_key('id'):
|
||||||
|
src['planet_id'] = feed.feed.id
|
||||||
else:
|
else:
|
||||||
src = feed.feed
|
src = feed.feed
|
||||||
|
|
||||||
|
@ -81,7 +81,9 @@ def splice():
|
|||||||
if sources:
|
if sources:
|
||||||
ids = sources[0].getElementsByTagName('id')
|
ids = sources[0].getElementsByTagName('id')
|
||||||
if ids and ids[0].childNodes[0].nodeValue not in sub_ids:
|
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
|
# add entry to feed
|
||||||
feed.appendChild(entry.documentElement)
|
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