Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13874 closed enhancement (fixed)

[PATCH] Support Jinja2 Templates

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: ExportImportXlsPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 1.4


I was looking for a plugin to add tickets for an organizational process that is repeated regularly and has a lot of tasks. I decided this plugin looked like it would be good for that purpose.

This plugin seems to work fine for our use case, but if possible I want to use all plugins that are not obsolete by requiring Genshi, so I ported it to use Jinja2. Sorry, I'm not an expert, but so far it seems to work. There could probably be some amount of simplification that would make it more readable.

See the attached patch. I'm using Trac 1.4.2.

Attachments (1)

exportimportxlsplugin_jinja_templates.patch (20.9 KB) - added by anonymous 4 years ago.
The Jinja2 template patch for ExportImportXlsPlugin

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by anonymous

The Jinja2 template patch for ExportImportXlsPlugin

comment:1 Changed 4 years ago by Ryan J Ollos

Owner: changed from ben_12 to Ryan J Ollos
Status: newaccepted

comment:2 Changed 4 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17846:

0.3: Add Jinja2 template for Trac 1.4+

Fixes #13874.

comment:3 Changed 4 years ago by Ryan J Ollos

Thanks. I learned something. As seen in your patch hasattr(Chrome, 'jenv') is sufficient and hasattr(Chrome(self.env), 'jenv'), that I had used on many occasions, unnecessarily instantiates an object.

comment:4 Changed 4 years ago by anonymous

Keen observation on your part! But not so much on mine, as that snippet already existed in this plugin. So we'll have to thank the author of the previous change, and maybe I'll need to go back and update the other plugins I'm using. At least in my local copies. lol

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.