Package: repoze.bfg.chameleon_genshi
repoze.bfg.chameleon_genshiBindings for Chameleon Genshi-style templating support underrepoze.bfg.  See theChameleon websiteforchameleon.genshitemplating
language details.The API for use ofrepoze.bfg.chameleon_genshiunder BFG is
identical to the one used forchameleon.zpt`templates as documented
in the “Templating” chapter of theBFG docs.
Only the templating language itself (Genshi vs. ZPT) and import
locations (r.b.chameleon_genshi vs. r.b.chameleon_zpt) differ.An example:from repoze.bfg.chameleon_genshi import render_template_to_response
render_template_to_response('relative/path/to/template')relative/path/to/templateis relative to the package directory in
which the above code is defined.See also therender_templateandget_templateAPIs exposed by
therepoze.bfg.chameleon_genshipackage, which serve the same
purpose as their brethren inrepoze.bfg.chameleon_zpt.Genshi templates can also be used as a BFG “renderer” when you userepoze.bfg.chameleon_genshi.  The easiest way to allow for this is
to use the following ZCML in your application’sconfigure.zcml:<include package="repoze.bfg.chameleon_genshi"/>Once your application has been set up to process this ZCML, your
application can point atchameleon.genshitemplates that have the.genshifile extension from within@bfg_viewdirectives or
ZCMLviewdirectives in your application.  For example:@bfg_view(renderer='templates/foo.genshi')
def someview(request):
    ....Or:<view
  renderer="templates/foo.genshi"
  view=".views.someview"/>If you’d rather not use a.genshiextension for yourchameleon.genshitemplates, or if you’d rather not use ZCML to do
registration, you can explicitly register a renderer using theadd_renderermethod of a “configurator”.  To do so, in therun.pyof your BFG application, in the function called at startup,
which uses arepoze.bfg.configuration.Configuratorasconfig:from repoze.bfg.chameleon_genshi import renderer_factory
config.add_renderer('.cgenshi', renderer_factory)Once you’ve registered.cgenshias a renderer in a view
configuration, you can do the following:@bfg_view(renderer='templates/foo.cgenshi')
def someview(request):
    ....MiscBy default, Chameleon’s Genshi XIncludes support cannot resolverepoze.bfg“resource specifications”
(e.g.my_package:foo/bar.genshi).  In order to activate an
XIncludes class that understands repoze.bfg resource specifications,
call therepoze.bfg.chameleon_genshi.XIncludes.activatemethod
before using any templates (e.g., at process startup time):from repoze.bfg.chameleon_genshi import XIncludes
XIncludes.activate()This will replace the XIncludes helper class for all consumers of
Chameleon in the process.repoze.bfg.chameleon_genshi0.3 (2010-07-09)By default, Chameleon’s Genshi XIncludes support cannot resolverepoze.bfg“resource specifications”
(e.g.my_package:foo/bar.genshi).  In order to activate an
XIncludes class that understands repoze.bfg resource specifications,
call therepoze.bfg.chameleon_genshi.XIncludes.activatemethod
before using any templates (e.g., at process startup time):from repoze.bfg.chameleon_genshi import XIncludes
XIncludes.activate()This will replace the XIncludes helper class for all consumers of
Chameleon in the process.Depend on Chameleon >= 1.2.8 (replaceable XIncludes class).0.2 (2010-06-15)Bring up to speed with BFG 1.3.X.0.1 (2009-05-02)Initial release (break code out of BFG core).