Modify

#11638 closed defect (fixed)

Breaking Python 2.4 compatibility of 2.2.2

Reported by: jun66j5 Owned by: olemis
Priority: normal Component: ThemeEnginePlugin
Severity: normal Keywords: py24
Cc: Trac Release: 0.12

Description

I got the following error with Python 2.4.

TemplateSyntaxError: invalid syntax (/home/jun66j5/.python-eggs/TracThemeEngine-2.2.2dev-py2.4.egg-tmp/themeengine/templates/admin_theme_advanced.html, line 37)
TemplateSyntaxError: invalid syntax (/home/jun66j5/.python-eggs/TracThemeEngine-2.2.2dev-py2.4.egg-tmp/themeengine/templates/admin_theme.html, line 50)

The template files use expr if cond else expr syntax introduced in Python 2.5.

  • themeengine/templates/admin_theme.html

     
    4747      <div id="themebuttons">
    4848        <img src="${href.chrome('themeengine', 'img', 'next.gif')}" border="0" id="nextbutton" />
    4949        <img src="${href.chrome('themeengine', 'img', 'prev.gif')}" border="0" id="prevbutton" />
    50         <input type="submit" value="${dgettext('themeengine', 'Use this theme')}" class="${'btn' if bhdb else None}"/>
     50        <input type="submit" value="${dgettext('themeengine', 'Use this theme')}" class="${(None, 'btn')[bool(bhdb)]}" />
    5151      </div>
    5252    </form>
    5353
  • themeengine/templates/admin_theme_advanced.html

     
    3434        <textarea name="css" rows="40" cols="80">$css</textarea>
    3535      </fieldset>
    3636      <div class="buttons">
    37         <input type="submit" value="${dgettext('themeengine', 'Submit')}" class="${'btn' if bhdb else None}" />
     37        <input type="submit" value="${dgettext('themeengine', 'Submit')}" class="${(None, 'btn')[bool(bhdb)]}" />
    3838      </div>
    3939    </form>
    4040  </body>

Attachments (0)

Change History (1)

comment:1 Changed 13 months ago by olemis

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

In 13788:

ThemeEnginePlugin [ fixes #11638 ] Remove x if c else y expressions from templates

Add Comment

Modify Ticket

Action
as closed The owner will remain olemis.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.