index.html.genshi chokes on feed.links

mictlan tecutli mictlan.tecutli.0 at gmail.com
Tue May 5 13:24:54 EST 2009


hi, 

genshi seems to be failing on several feedparser atributes. in the following example in fails on "feed.link". 

  File "/home/ashitaka/www/venus/themes/genshi_fancy/index.html.genshi", line 21, in <Expression u'link.title'>
    <link py:for="link in feed.links"
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 321, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 405, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: {'href': u' http://atom.xml',
'type': u'application/atom+xml', 'rel': u'self'} has no member named
"title"

if i remove "<link py:for="link in feed.links"
  py:if="link.type in ['application/atom+xml','application/rss+xml']"
  href="$link.href" rel="alternate" title="$link.title"
type="$link.type"/>"

then it fails on entry.link. i tried removing the element where there error occures, but there always seems to be one.  

File "/home/ashitaka/www/venus/themes/genshi_fancy/index.html.genshi", line 32, in <Expression u'entry.link'>
    <h3 py:if="entry.new_feed"><a href="$entry.link" title="$entry.source.title">$entry.source.config.name</a></h3>
...
has no member named "link"

my command and original error:

~/www/venus/themes/genshi_fancy$ rm -r cache/*; ../../planet.py --verbose config.ini 
INFO:planet.runner:Socket timeout set to 20 seconds
INFO:planet.runner:Building work queue
INFO:planet.runner:Updating feed http://www.wglt.org/podcasts/GLT_Jazz_Next.xml
ERROR:planet.runner:Error 500 while updating feed subscription
INFO:planet.runner:Loading cached data
DEBUG:planet.runner:Processing template /home/ashitaka/www/venus/themes/common/atom.xml.xslt using xslt
DEBUG:planet.runner:Processing template /home/ashitaka/www/venus/themes/common/foafroll.xml.xslt using xslt
DEBUG:planet.runner:Processing template /home/ashitaka/www/venus/themes/genshi_fancy/index.html.genshi using genshi
Traceback (most recent call last):
  File "../../planet.py", line 68, in <module>
    splice.apply(doc.toxml('utf-8'))
  File "/home/ashitaka/www/venus/planet/splice.py", line 118, in apply
    output_file = shell.run(template_file, doc)
  File "/home/ashitaka/www/venus/planet/shell/__init__.py", line 66, in run
    module.run(template_resolved, doc, output_file, options)
  File "/home/ashitaka/www/venus/planet/shell/_genshi.py", line 136, in run
    output=tmpl.generate(context).render('xml')
  File "/var/lib/python-support/python2.5/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/var/lib/python-support/python2.5/genshi/output.py", line 60, in encode
    return _encode(u''.join(list(iterator)))
  File "/var/lib/python-support/python2.5/genshi/output.py", line 210, in __call__
    for kind, data, pos in stream:
  File "/var/lib/python-support/python2.5/genshi/output.py", line 592, in __call__
    for kind, data, pos in stream:
  File "/var/lib/python-support/python2.5/genshi/output.py", line 698, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/var/lib/python-support/python2.5/genshi/output.py", line 532, in __call__
    for ev in stream:
  File "/var/lib/python-support/python2.5/genshi/core.py", line 283, in _ensure
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/markup.py", line 245, in _match
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 543, in _exec
    for event in stream:
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 510, in _eval
    **vars):
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 520, in _eval
    result = _eval_expr(data, ctxt, **vars)
  File "/var/lib/python-support/python2.5/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/home/ashitaka/www/venus/themes/genshi_fancy/index.html.genshi", line 21, in <Expression u'link.title'>
    <link py:for="link in feed.links"
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 321, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/var/lib/python-support/python2.5/genshi/template/eval.py", line 405, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: {'href': u' http://atom.xml',
'type': u'application/atom+xml', 'rel': u'self'} has no member named
"title"

my config.ini:

[Planet]
name:Pod
link:
  http://acervo.org

template_files:
  atom.xml.xslt
  foafroll.xml.xslt
  index.html.genshi
  opml.xml.xslt
  rss10.xml.tmpl
  rss20.xml.tmpl

template_directories:
  ./
  ../common
  ../classic_fancy

bill_of_materials:
  planet.css
  images/feed-icon-10x10.png
  images/logo.png
  images/venus.png

[subscription]
[http://intertwingly.net/code/venus/index.atom]
name:venus


More information about the devel mailing list