Created
April 17, 2009 01:01
-
-
Save rtyler/96792 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tyler@papaya:~> less foo.tmpl | |
from BaseClass import BaseClass | |
class $module.module(BaseClass): | |
pass | |
tyler@papaya:~> python | |
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18) | |
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from Cheetah.Template import Template | |
>>> class FakeModule(object): | |
... module = 'Fakey' | |
... | |
>>> t = Template (file="foo.tmpl",searchList=[{'module' : FakeModule()}]) | |
>>> f = open('genfoo.py', 'w') | |
>>> f.write(str(t)) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/local/lib64/python2.6/site-packages/Cheetah/Template.py", line 988, in __str__ | |
return getattr(self, mainMethName)() | |
File "_home_tyler_foo_tmpl.py", line 88, in respond | |
NameError: global name 'BaseClass' is not defined | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment