incubator-bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matevz Bradac <mate...@gmail.com>
Subject Re: Genshi XHTML + HTML 5
Date Sat, 01 Dec 2012 16:08:03 GMT
Thanks. I wanted to avoid monkeypatching render_template(), as it's
not a small/trivial function.
There may be better candidates for this though, such as the Stream.serialize().
Which brings up another question - if we do override trac's functions,
should we keep a list of such
changes somewhere, so that when we introduce a new trac version into
BH things get synced properly?

--
matevz

On Thu, Nov 29, 2012 at 10:53 PM, Branko ─îibej <brane@wandisco.com> wrote:
> On 29.11.2012 22:02, Matevz Bradac wrote:
>> Would it be possible to do this in the post processing phase, i.e.
>> IRequestFilter's post_process_request()?
>> If not, is there any way of overriding trac's behaviour without
>> modifying trac itself?
>
> Sure is.
>
> def better_render_template(self, etc...)
>   pass
>
> import chrome
> chrome.Chrome.render_template = better_render_template
>
> This change will persist for the duration of the Python interpreter,
> even across subsequent "import chrome" statements. It's best to do this
> very early during BH intialization.
>
> N.B.: I haven't actually looked at what the names of the modules
> actually are, but you get the idea.
>
> -- Brane
>
> --
> Branko ─îibej
> Director of Subversion | WANdisco | www.wandisco.com
>

Mime
View raw message