Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install repoze.bfg.chameleon-genshi

How to install repoze.bfg.chameleon_genshi

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install repoze.bfg.chameleon-genshi
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3 Available View build log
Windows (64-bit)
0.3 Available View build log
Mac OS X (10.5+)
0.3 Available View build log
Linux (32-bit)
0.3 Available View build log
Linux (64-bit)
0.3 Available View build log
 
License
BSD-derived (http://www.repoze.org/LICENSE.txt)
Lastest release
version 0.3 on Jan 5th, 2011
repoze.bfg.chameleon_genshi
===========================

Bindings for Chameleon Genshi-style templating support under
`repoze.bfg `_.  See the `Chameleon website
`_ for ``chameleon.genshi`` templating
language details.

The API for use of ``repoze.bfg.chameleon_genshi`` under BFG is
identical to the one used for `chameleon.zpt`` templates as documented
in the "Templating" chapter of the `BFG 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/template`` is relative to the package directory in
which the above code is defined.

See also the ``render_template`` and ``get_template`` APIs exposed by
the ``repoze.bfg.chameleon_genshi`` package, which serve the same
purpose as their brethren in ``repoze.bfg.chameleon_zpt``.

Genshi templates can also be used as a BFG "renderer" when you use
``repoze.bfg.chameleon_genshi``.  The easiest way to allow for this is
to use the following ZCML in your application's ``configure.zcml``::



Once your application has been set up to process this ZCML, your
application can point at ``chameleon.genshi`` templates that have the
``.genshi`` file extension from within ``@bfg_view`` directives or
ZCML ``view`` directives in your application.  For example::

@bfg_view(renderer='templates/foo.genshi')
def someview(request):
....

Or::



If you'd rather not use a ``.genshi`` extension for your
``chameleon.genshi`` templates, or if you'd rather not use ZCML to do
registration, you can explicitly register a renderer using the
``add_renderer`` method of a "configurator".  To do so, in the
``run.py`` of your BFG application, in the function called at startup,
which uses a ``repoze.bfg.configuration.Configurator`` as ``config``::

from repoze.bfg.chameleon_genshi import renderer_factory
config.add_renderer('.cgenshi', renderer_factory)

Once you've registered ``.cgenshi`` as a renderer in a view
configuration, you can do the following::

@bfg_view(renderer='templates/foo.cgenshi')
def someview(request):
....

Misc
----

By default, Chameleon's Genshi XIncludes support cannot resolve
``repoze.bfg`` "resource specifications"
(e.g. ``my_package:foo/bar.genshi``).  In order to activate an
XIncludes class that understands repoze.bfg resource specifications,
call the ``repoze.bfg.chameleon_genshi.XIncludes.activate`` method
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_genshi
===========================

0.3 (2010-07-09)
----------------

- By default, Chameleon's Genshi XIncludes support cannot resolve
``repoze.bfg`` "resource specifications"
(e.g. ``my_package:foo/bar.genshi``).  In order to activate an
XIncludes class that understands repoze.bfg resource specifications,
call the ``repoze.bfg.chameleon_genshi.XIncludes.activate`` method
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).

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.