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

Opened 9 years ago

Last modified 9 years ago

tg.defaultview = "genshi" and tg.mochikit_suppress = True raises Exception Attribute Error

Reported by: dazzaredgrave Owned by: faide
Priority: normal Milestone: 1.1
Component: TurboGears Version: 1.0.4.3
Severity: normal Keywords:
Cc:

Description

if you set these options in your app.cfg an AttributeError? is raised:

  • tg.defaultview = "genshi"
  • tg.mochikit_suppress = True

trace can be found  here. tg-admin info can be found  here

It's raised because the display of the turbogears.base.Widget.display returns an empty list when turbogears.base.MochiKitLink?.template is rendered AND suppress is True. I have 'fixed' it locally by changing turbogears.base.MochiKitLink?.template to:

    <span xmlns:py="http://purl.org/kid/ns#" py:strip="True">
        <script py:if="not suppress" type="text/javascript" src="$link"/>
        <script py:if="suppress" type="text/javascript"></script>
    </span>

The trade off here is that when mochikit is supressed you get an empty script tag appear in the head of the rendered page. The alternative is to check turbogears.base:280 transforms return value and make an ElementTree? from the empty list returned. A data change seemed safer to me.

Change History

comment:1 Changed 9 years ago by droggisch

  • Owner changed from anonymous to droggisch

comment:2 Changed 9 years ago by droggisch

  • Owner changed from droggisch to faide

Fixed as suggested - I don't think that anything more fancy as fix is needed & that an empty <script>-tag doesn't cause any problems.

comment:3 Changed 9 years ago by droggisch

Revision is r4601

comment:4 Changed 9 years ago by faide

  • Milestone changed from 1.5 to 1.1

comment:5 Changed 9 years ago by Chris Arndt

Can this ticket be closed or do you still plan to implement the alternative solution?

comment:6 Changed 9 years ago by faide

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

Seems fine to me... Let's close this one.

Note: See TracTickets for help on using tickets.