Opened 5 years ago

Closed 5 years ago

#11638 closed defect (fixed)

Breaking Python 2.4 compatibility of 2.2.2

Reported by: Jun Omae Owned by: Olemis Lang
Priority: normal Component: ThemeEnginePlugin
Severity: normal Keywords: py24
Cc: Trac Release: 0.12


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="${'themeengine', 'img', 'next.gif')}" border="0" id="nextbutton" />
    4949        <img src="${'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>
  • 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 5 years ago by Olemis Lang

Resolution: fixed
Status: newclosed

In 13788:

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

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Olemis Lang.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.