Default channel_name to source title

This commit is contained in:
Sam Ruby 2008-10-10 08:52:59 -04:00
parent f3e57e261a
commit c619402e6e
2 changed files with 15 additions and 0 deletions

View File

@ -167,6 +167,8 @@ def tmpl_mapper(source, rules):
for name,value in source.source.items(): for name,value in source.source.items():
if name.startswith('planet_'): if name.startswith('planet_'):
output['channel_' + name[7:]] = String(value) output['channel_' + name[7:]] = String(value)
if not output.get('channel_name'):
output['channel_name'] = source.source.get('title', '')
return output return output

View File

@ -0,0 +1,13 @@
<!--
Description: id
Expect: Items[0]['channel_name'] == 'blog title'
-->
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<source>
<title>blog title</title>
</source>
</entry>
</feed>