/venus

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/venus/

« back to all changes in this revision

Viewing changes to planet/shell/tmpl.py

  • Committer: Jacques Distler
  • Date: 2009-01-09 22:11:25 UTC
  • mfrom: (107.1.2 venus)
  • Revision ID: distler@golem.ph.utexas.edu-20090109221125-znc05utxsv6nbzbe
From Sam Ruby

Show diffs side-by-side

added added

removed removed

197
197
    # apply rules to convert feed parser output to htmltmpl input
198
198
    output = {'Channels': [], 'Items': []}
199
199
    output.update(tmpl_mapper(data.feed, Base))
200
 
    sources = [(source.get('planet_name',None),source)
201
 
        for source in data.feed.get('sources',[])]
 
200
    sources = []
 
201
    for feed in data.feed.get('sources',[]):
 
202
        source = tmpl_mapper(feed, Base)
 
203
        sources.append([source.get('name'), source])
202
204
    sources.sort()
203
 
    for name, feed in sources:
204
 
        output['Channels'].append(tmpl_mapper(feed, Base))
 
205
    output['Channels'] = [source for name,source in sources]
205
206
    for entry in data.entries:
206
207
        output['Items'].append(tmpl_mapper(entry, Items))
207
208