The post_process_request receives the
returned values from process_request. For Jinja2 templates, the process_request
should return a tuple of (template, data).
See
https://trac.edgewall.org/wiki/TracDev/PortingFromGenshiToJinja#IRequestHandler
Therefore, before implementing IRequestFilter
interface, the returned values of process_request
should be modified and the template should be ported to Jinja2
from Genshi.
Index:
trachours/hours.py
===================================================================
--- trachours/hours.py (revision 18705)
+++ trachours/hours.py (working copy)
@@ -384,8 +384,8 @@
data['queries'] = get_all_dict(self.env, """
SELECT id, title, description, query FROM
ticket_time_query
""")
- return 'hours_listqueries.html', data, 'text/html'
- return 'hours_savequery.html', data, 'text/html'
+ return 'hours_listqueries.html', data
+ return 'hours_savequery.html', data
def process_query(self, req):
"""redict to save, edit or delete a query based on
arguments"""
@@ -842,7 +842,7 @@
add_stylesheet(req, 'common/css/report.css')
add_script(req, 'common/js/query.js')
- return 'hours_timeline.html', data, 'text/html'
+ return 'hours_timeline.html', data
def process_ticket(self, req):
"""process a request to /hours/<ticket number>"""
@@ -901,7 +901,7 @@
add_ctxtnav(req, 'Back to Ticket #%s' % ticket_id,
req.href.ticket(ticket_id))
- return 'hours_ticket.html', data, 'text/html'
+ return 'hours_ticket.html', data
# Methods for transforming data to rss
Index: trachours/multiproject.py
===================================================================
--- trachours/multiproject.py (revision 18705)
+++ trachours/multiproject.py (working copy)
@@ -204,7 +204,7 @@
data['total'] = hours_format % total
- return 'hours_multiproject.html', data, 'text/html'
+ return 'hours_multiproject.html', data
if __name__ == '__main__':
Index: trachours/web_ui.py
===================================================================
--- trachours/web_ui.py (revision 18705)
+++ trachours/web_ui.py (working copy)
@@ -311,7 +311,7 @@
# _('Next Week'))
# prevnext_nav(req, _('Prev Week'), _('Next Week'))
- return 'hours_users.html', data, "text/html"
+ return 'hours_users.html', data
def user(self, req, user):
"""hours page for a single user"""
@@ -360,7 +360,7 @@
req.send(buffer.getvalue(), 'text/csv')
- return 'hours_user.html', data, 'text/html'
+ return 'hours_user.html', data
def export_csv(self, req, data, sep=',',
mimetype='text/csv'):
content = StringIO()