[Buildbot-devel] jinja: user customization and public_html?

Stefan Seefeld seefeld at sympatico.ca
Sun Dec 20 22:28:50 UTC 2009


On 12/20/2009 11:29 AM, Marcus Lindblom wrote:
> On 2009-12-20 17:10, Dustin J. Mitchell wrote:
>    
>> Sorry to self-reply, but I think I answered my own question, on
>> finding this snippet in web/baseweb.py:
>>
>>           default_loader = jinja2.PackageLoader('buildbot.status.web',
>> 'templates')
>>           root = os.path.join(os.getcwd(), 'templates')
>>           loader = jinja2.ChoiceLoader([jinja2.FileSystemLoader(root),
>>                                         default_loader])
>>           self.templates = jinja2.Environment(loader=loader,
>>                                               extensions=['jinja2.ext.i18n'],
>>                                               trim_blocks=True,
>>                                               undefined=AlmostStrictUndefined)
>>
>>  From what I can tell, this means that $basedir/templates can override
>> built-in templates on a page-by-page basis, right?
>>      

Yes.

> Stefan wrote that, but what I think is, that it tries to load from an
> egg first (PackageLoader), then use the FileSystemLoader to load
> directly from disk.
>    

The idea is to system-wide templates be provided with the buildbot 
installation, but allow a buildbot instance to override them (selectively).


> So.. nope, you won't get that by default... but we could probably add
> chain another ChoiceLoader into there that looks somewhere where the
> user could put his/her custom HTML, to override specific files. (one, a
> few or all.)
>    

Who is 'the user' here ? Is it the person who runs the buildbot instance 
?  Why aren't instance-specific templates enough ? (I assume the user 
who runs the instance is  the one who starts the buildbot master 
process, which ultimately loads the templates.)

     Stefan


-- 

       ...ich hab' noch einen Koffer in Berlin...





More information about the devel mailing list