Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python interface to CTPP2 library.

Project Description

Example of usage

Make template file hello.tmpl:

Foo: <TMPL_var foo.bar>
Spam: <TMPL_var foo[spam]>
Array:
    <TMPL_var array[0].key>
    <TMPL_var array[1]['key']>

Create Python script:

#!/usr/bin/env python

import pyctpp2

if __name__ == '__main__':
    engine = pyctpp2.Engine()

    template = engine.parse('hello.tmpl')

    result = template.render({
        'foo': { 'bar': 'baz' },
        'spam': 'bar',
        'array': [
            { 'key': 'first' },
            { 'key': 'second' } ]
    })

Check output:

Foo: baz
Spam: baz
Array:
    first
    second

See pydoc pyctpp2.Engine and pydoc pyctpp2.Template for more information.

CHANGES

0.12.2 (19.01.2012)

  • Fixed version.py.

0.12.1 (19.01.2012)

  • Fixed version.py.

0.12.0 (19.01.2012)

  • Updated documentation.
  • Fixed searching CTPP2 library.
  • Fixed support of Python 3.
  • Support CTPP2 library >= 2.8 version only.

0.11.2 (13.09.2011)

  • Fixed Restructed text syntax.
  • Updated documentation.
  • Fixed setup.py.
  • Fixed bug with empty language.
  • Updated build without cython.

0.11.1 (30.06.2011)

  • Fixed extract method ‘ctpp2’ for Babel.

0.11.0 (29.06.2011)

  • Added support of new CTPP2 gettext implementation.
  • Support CTPP2 library >= 2.7 version only.

0.10.0 (23.05.2011)

  • Added support of array/hash indirect calls (foo{bar} and foo[bar]).
  • Support CTPP2 library >= 2.6.16 version only.

0.9.10 (17.05.2011)

  • Added duplicate information about dicts for HASH_ELEMENT support.

0.9.9 (17.05.2011)

  • Fixed HASH_ELEMENT support.

0.9.8 (12.05.2011)

  • Fixed extract method ‘ctpp2’ for Babel.

0.9.7 (28.04.2011)

  • Fixed support of render params with types.LongType.

0.9.6 (19.04.2011)

  • Fixed extract method ‘ctpp2’ for Babel.

0.9.5 (19.04.2011)

  • Fixed build with Cython.

0.9.4 (19.04.2011)

  • Added extract method ‘ctpp2’ for Babel.

0.9.3 (15.04.2011)

  • Added support of i18n.
  • Fixed tests.
  • Changed Template and Engine API.

0.9.2 (28.03.2011)

  • Fixed installation by pip.

0.9.1 (13.01.2011)

  • Added COPYING.txt.
  • Added support of traversable objects.
  • Some bug fixes.

0.9.0 (11.01.2011)

  • Initial release.
Release History

Release History

This version
History Node

0.12.2

History Node

0.11.2

History Node

0.11.1

History Node

0.10.0

History Node

0.9.10

History Node

0.9.9

History Node

0.9.8

History Node

0.9.7

History Node

0.9.6

History Node

0.9.5

History Node

0.9.4

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyctpp2-0.12.2.tar.gz (73.2 kB) Copy SHA256 Checksum SHA256 Source Jan 24, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting