Return-Path: X-Original-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8452DE3E for ; Sat, 1 Dec 2012 16:09:15 +0000 (UTC) Received: (qmail 64581 invoked by uid 500); 1 Dec 2012 16:09:15 -0000 Delivered-To: apmail-incubator-bloodhound-dev-archive@incubator.apache.org Received: (qmail 64470 invoked by uid 500); 1 Dec 2012 16:09:12 -0000 Mailing-List: contact bloodhound-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bloodhound-dev@incubator.apache.org Delivered-To: mailing list bloodhound-dev@incubator.apache.org Received: (qmail 64425 invoked by uid 99); 1 Dec 2012 16:09:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 16:09:11 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of matevzb@gmail.com designates 209.85.219.47 as permitted sender) Received: from [209.85.219.47] (HELO mail-oa0-f47.google.com) (209.85.219.47) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 16:09:04 +0000 Received: by mail-oa0-f47.google.com with SMTP id h1so1426661oag.6 for ; Sat, 01 Dec 2012 08:08:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=1Dz+wXn45dhwXTWgstgtX7pZsgv9leMsnDRrmOFcfKE=; b=vnLXA5oYsaTV+it6k3CmibSDtUpXo5U6yekyEkA8xg2VNKoFt/Obsb+3VVZhsL0jPW oNU1KgsdjDKhogbr4SsBgak5cFqJoQtgCmNqOULkZvAq27I1QOOLwgGx4WrFA78REuvA NNheA+OdTihAciad89wug701SFhyi0n3veOVSY65drw2B5jkOEZM5fRjXSkGL0mK3MS0 dV8NPaqNrIATps2Wfnf/2+V5oN96i1Ufs2iAjHIXu3TK1DgETAuF2l1Bkb6kmgDRTGIR y7iVGXb7xoqUMLigGr8TwCYdpaY3/qMUmi1d5f/HfF+xb3iKXPu+TslqVRNkQg2huMIV IKkA== Received: by 10.182.92.70 with SMTP id ck6mr373616obb.46.1354378123412; Sat, 01 Dec 2012 08:08:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.73.138 with HTTP; Sat, 1 Dec 2012 08:08:03 -0800 (PST) In-Reply-To: <50B7D94F.7060706@wandisco.com> References: <2BA32F18-E010-433A-8E9F-359192ABA8F8@wandisco.com> <50B7D94F.7060706@wandisco.com> From: Matevz Bradac Date: Sat, 1 Dec 2012 17:08:03 +0100 Message-ID: Subject: Re: Genshi XHTML + HTML 5 To: bloodhound-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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.serializ= e(). 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 =C4=8Cibej wr= ote: > 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 =3D 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 =C4=8Cibej > Director of Subversion | WANdisco | www.wandisco.com >