On 12/21/12, Peter Koželj <[email protected]> wrote: > On 19 December 2012 18:04, Olemis Lang <[email protected]> wrote: >> On 12/19/12, Peter Koželj <[email protected]> wrote: >> [...] >> >> If so neither chrome nor data (and related complications) would be >> needed . Instance methods would be more than enough . What do you >> think ? >> > > Actually adding labels to req.chrome in lazy manner is a bit messy but not > that difficult at all. What I tried and works is: > > {{{ > > if 'chrome' in req.__dict__: > req.chrome['labels'] = self._get_whitelabelling() > else: > original_chrome_callback = req.callbacks['chrome'] > > def chrome_with_labels_callback(req): > chrome = original_chrome_callback(req) > chrome['labels'] = self._get_whitelabelling() > return chrome > > req.callbacks['chrome'] = chrome_with_labels_callback > > }}} >
that's looking better ;) > Unfortunately this doesn't make any difference at all as req.chrome is > evaluated at a few other places like: > - multiple places in bloodhound_theme and (this should be easily fixable > if we know how to distinguish RPC from UI templates calls) easy , for RPC calls and alike template = data = None ;) > - multiple places in TracThemeEngine (this is not fixable without changes > to the plugin or maybe Trac or even both) > > Apparently the scope of this issue is bigger then whitelabeling and should > be approached with all aspects of request handling in mind. > Optimally the RPC requests should probably not include BloodhoundTheme jftr , RPC doesn't do such a thing . BhT is actively watching and post-processing all requests even if theme is not active (i.e. theme.theme config coption != bloodhound) , even if no template is rendered (i.e. template = data = None) , ... That's why I've always insisted on the fact that it's important to limit the impact of theme post processing to theme component enabled + theme active + we really care ;) -- Regards, Olemis. Blog ES: http://simelo-es.blogspot.com/ Blog EN: http://simelo-en.blogspot.com/ Featured article:
