Tempita is a small templating language for text substitution. (LADI project)
Go to file
Graham Higgins abe6a7282d From: Stefan Behnel
Date: Fri, Jul 26, 2013 at 1:35 AM
Subject: small performance patch for Tempita

we're using Tempita for some code generation bits in Cython (simply because
it's small enough to embed it), and I found that it spends quite some
processing time figuring out the line/column position in the template.
Initialisation time is important because templates are often just executed
once or a couple of times in Cython. Here's a little patch that speeds that
part up. The main problem is string.splitlines(), which adds a substantial
overhead for just counting lines.

The patch doesn't care about the line ending format of the file, not sure
if that's a problem. You might want to use regexes if it is. Also, I didn't
really find any tests for this code, so I've probably broken it with an
off-by-one or something. It seems to give the same error positions as
before, though.

Stefan
2013-08-28 11:42:45 +01:00
docs fix failing test 2011-08-28 10:44:25 -07:00
tempita From: Stefan Behnel 2013-08-28 11:42:45 +01:00
tests Make testing under py2/py3 more robust 2013-03-19 15:02:05 +00:00
.hgignore some minor doc updates 2010-09-05 20:55:45 -07:00
.travis.yml Satisfy flake8 req for travis. 2013-03-19 15:23:29 +00:00
MANIFEST.in Expand py3compat 2013-03-19 13:36:32 +00:00
README.md Added README.md for ease-of-github. 2013-03-19 15:19:06 +00:00
regen-docs sphinx-ify 2008-05-29 01:25:49 +00:00
requirements.txt Satisfy flake8 req for travis. 2013-03-19 15:23:29 +00:00
setup.cfg make contemporary 2013-03-19 15:00:58 +00:00
setup.py Expand py3compat 2013-03-19 13:36:32 +00:00
tox.ini Make testing under py2/py3 more robust 2013-03-19 15:02:05 +00:00

README.md

Tempita

A small templating language for text substitution, originally authored by Ian Bicking.

It isn't intended to be the Next Big Thing in templating, just a handy little templating language for when a project outgrows string.Template or {} substitution.

It's small, it embeds Python in strings, and it doesn't do much else.

You can read about the language, the interface and that's it, there's nothing more to learn about it.

You can install the original 0.5 from the bitbucket repository with:

easy_install Tempita==dev

Note from gjhiggins

I transmigrated this to GitHub in order to take advantage of travis-ci continuous integration and took the opportunity to give the py3 compat and tests a buffing (March 2013).

Build Status