Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1644 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

displays_on="genshi" does not seem to work if the default template is "kid"

Reported by: ccurvey Owned by: alberto
Priority: normal Milestone: 1.5
Component: ToscaWidgets Version: 1.0.4b2
Severity: normal Keywords:


I tried using the "displays_on" parameter for a widget when the default template for my app is kid, but it gives me a "need more than 2 values to unpack" error:

the call to the template is

    <div id="ArtPicks" class="invisible">
        <h4>Art Posts</h4>
        ${artPostGrid(artPosts, displays_on="genshi")}

The relevant part of app.cfg is

tg.defaultview = "kid"
#tg.defaultview = 'genshi'

and the stack trace is:

Page handler: <bound method Root.index of <turbotown.controllers.Root object at 0x8f312ac>>
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cphttptools.py", line 105, in _run
  File "/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/controllers.py", line 344, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/database.py", line 316, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/controllers.py", line 359, in <lambda>
    mapping, fragment, args, kw)))
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/controllers.py", line 399, in _execute_func
    return _process_output(output, template, format, content_type, mapping, fragment)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/controllers.py", line 86, in _process_output
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b2-py2.5.egg/turbogears/view/base.py", line 129, in render
    return engine.render(**kw)
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/plugin.py", line 107, in render
    return self.transform(info, template).render(**kwargs)
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/core.py", line 154, in render
    return encode(generator, method=method, encoding=encoding)
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/output.py", line 45, in encode
    output = u''.join(list(iterator))
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/output.py", line 274, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/output.py", line 519, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/output.py", line 679, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/output.py", line 459, in __call__
    for ev in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/core.py", line 212, in _ensure
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 253, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 340, in _match
    match_templates[idx + 1:]):
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 323, in _match
    content = list(self._include(content, ctxt))
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 253, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 298, in _match
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/markup.py", line 287, in _strip
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/base.py", line 432, in _eval
    for event in substream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/template/base.py", line 398, in _eval
    for kind, data, pos in stream:
ValueError: need more than 2 values to unpack

If I set the default template language to "genshi", it works fine. (But then I can't use CatWalk.)

You can see the original discussion here:  http://groups.google.com/group/toscawidgets-discuss/browse_thread/thread/1f02e835b6022da7

Change History

comment:1 Changed 11 years ago by Chris Arndt

  • Owner changed from anonymous to alberto
  • Component changed from genshi to toscaWidgets
  • Milestone changed from 1.0.4 to 1.1

This is a ToscaWidget issue. TG widgets don't work with Genshi anyway ==> movin this to milestone 1.1

comment:2 Changed 11 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

This ticket has been moved to ToscaWidgets?' Trac  http://beta.toscawidgets.org/trac/tw/ticket/13


Note: See TracTickets for help on using tickets.