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 #1230 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] ToscaWidgets tgsample master.kid: NameError: name 'tg_flash' is not defined

Reported by: jeffk Owned by: alberto
Priority: normal Milestone:
Component: ToscaWidgets Version: trunk
Severity: normal Keywords: toscawidgets
Cc:

Description

Running ToscaWidgets? tgsample app against TurboGears trunk, source:/projects/ToscaWidgets/trunk#2345 returns the following error:

2007-01-07 22:10:43,660 toscawidgets.mods.tg INFO Registering static directory '/software/svn/turbogears11/turbogears/static/js' at '/toscawidgets/turbogears/static/js'
2007-01-07 22:10:43,661 toscawidgets.mods.tg INFO Registering static directory '/software/svn/ToscaWidgetsForms/toscawidgets/widgets/forms/static/calendar' at '/toscawidgets/toscawidgets.widgets.forms.calendars/static/calendar'
2007-01-07 22:10:43,661 toscawidgets.mods.tg INFO Registering static directory '/software/svn/twMochiKit/toscawidgets/widgets/mochikit/static' at '/toscawidgets/toscawidgets.widgets.mochikit/static'
2007-01-07 22:10:43,662 toscawidgets.mods.tg INFO Registering static directory '/software/svn/ToscaWidgetsForms/toscawidgets/widgets/forms/static' at '/toscawidgets/toscawidgets.widgets.forms.datagrid/static'
2007-01-07 22:10:44,324 cherrypy.msg INFO HTTP: Page handler: <bound method Root.index of <tgsample.controllers.Root object at 0x874e84c>>
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
    self.main()
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "/software/svn/turbogears11/turbogears/controllers.py", line 284, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File "/software/svn/turbogears11/turbogears/database.py", line 249, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/software/svn/turbogears11/turbogears/controllers.py", line 301, in <lambda>
    mapping, fragment, args, kw)))
  File "/software/svn/turbogears11/turbogears/controllers.py", line 341, in _execute_func
    return _process_output(output, template, format, content_type, mapping, fragment)
  File "/software/svn/turbogears11/turbogears/controllers.py", line 81, in _process_output
    mapping=mapping, content_type=content_type,fragment=fragment)
  File "/software/svn/turbogears11/turbogears/view/base.py", line 126, in render
    return adapt_call(engine.render, **dict(info=info, format=format, fragment=fragment, template=template, mapping=mapping))
  File "/software/svn/turbogears11/turbogears/util.py", line 166, in adapt_call
    return func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 174, in render
    return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment)
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/__init__.py", line 236, in serialize
    return serializer.serialize(self, encoding, fragment)
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/serialization.py", line 51, in serialize
    text = list(self.generate(stream, encoding, fragment))
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/serialization.py", line 329, in generate
    for ev, item in self.apply_filters(stream):
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/pull.py", line 210, in _coalesce
    for ev, item in stream:
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/filter.py", line 21, in transform_filter
    for ev, item in apply_matches(stream, template, templates, apply_func):
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/filter.py", line 39, in apply_matches
    template, templates[:i] + templates[i+1:], apply_func):
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/filter.py", line 31, in apply_matches
    item = stream.expand()
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/pull.py", line 99, in expand
    for ev, item in self._iter:
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/pull.py", line 168, in _track
    for p in stream:
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/pull.py", line 210, in _coalesce
    for ev, item in stream:
  File "/software/svn/ToscaWidgets/examples/tgsample/tgsample/templates/master.py", line 122, in _match_func
NameError: name 'tg_flash' is not defined

The following change allows tgsample to run:

Index: examples/tgsample/tgsample/templates/master.kid
===================================================================
--- examples/tgsample/tgsample/templates/master.kid     (revision 2345)
+++ examples/tgsample/tgsample/templates/master.kid     (working copy)
@@ -33,7 +33,7 @@
         </span>
     </div>
 
-    <div py:if="tg_flash" class="flash" py:content="tg_flash"></div>
+    <div py:if="value_of('tg_flash', None)" class="flash" py:content="tg_flash"></div>
 
     <div py:replace="[item.text]+item[:]"/>

Change History

comment:1 Changed 11 years ago by alberto

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

Fixed in [2347]. Thanks :) Alberto

Note: See TracTickets for help on using tickets.