Questions tagged [cheetah]

Cheetah is an Open Source Python based Templating Framework.

Cheetah is an open source template engine and code generation tool, written in Python. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code.

from CheetahTemplate.org

It works with Python 2.7 and 3.4+. Wheels are available at PyPI. Issues and pull requests are accepted at GitHub.

69 questions
1
vote
1 answer

How do I use inheritance in Cheetah templates?

For Cheetah3, there is a very rough documentation of the inheritance feature: http://cheetahtemplate.org/users_guide/inheritanceEtc.html#extends But I don't get how to make it actually work. Let's assume I have two template files: A.tmpl #def…
nasezoll
  • 51
  • 5
1
vote
1 answer

variable nested templates in cheetah

i have a base template that calls a nested template based on a variable passed in, eg. page = 6 and what i want is to call some html as follows: ...
#include "templates/_page${page}.tmpl"
... what is the correct syntax for this?…
khany
  • 1,167
  • 15
  • 30
1
vote
1 answer

Static attributes in Cheetah

I'm working on a project using Cheetah. I'd like to create a class like the following one: from Cheetah.Template import Template class TemplateObject(Template): className = "Default ClassName" def header(self): return "My Class name…
Xatyrian
  • 1,324
  • 5
  • 25
1
vote
1 answer

syntax error with '$' sign ; Cheetah / bash

I work on a script running Cheetah ; at some point there are some bash commands and I got a syntax error ("Error in the Python code which Cheetah generated for this template"). The line involved is : && name=$(echo '\$another_variable'".phy" | cut…
Micawber
  • 563
  • 1
  • 4
  • 12
1
vote
1 answer

Append to existing dictionary in Cheetah-based template

I'm trying to add my own custom lines into the Cobbler snippet as Cheetah code. I can create a dictionary using #set, but how do I append to the same dictionary down the line? ... #set…
Riz Lee
  • 13
  • 2
1
vote
0 answers

Cheetah requires Python module Cheetah 2.1.0 or newer - laucnhing sickbeard

I am trying to use sickbeard on a mac via terminal. I have installed the latest version pf python (homebrew), then installed cheetah (git then python setup.py install). when finally i try to: python sickbeard.py I get this message: Sorry, requires…
Freddy
  • 15
  • 8
1
vote
1 answer

Python cheetah variables inside a #raw javascript block?

If I have a block of #raw that has javascript inside it and sometimes I need to access some python variables (the $foo in example case) from that javascript. #raw