[Cheetahtemplate-discuss] problem with include directive on cheetah 2.4.0
Brought to you by:
rtyler,
tavis_rudd
From: Uhanov, K. <kir...@in...> - 2009-11-13 09:28:50
|
Hi, All Could you help me with my issue? Some of my templates use include directive. But I have NameError error then I run generated py file. For example, I have tmpl and txt files (they are located in c:\__1 dir) temp.tmpl #include "temp.txt" temp.txt Hello Call compile cmdline command python C:\python\Scripts\cheetah-compile temp.tmpl Run generated py script: python temp.py Traceback (most recent call last): File "temp.py", line 124, in <module> CmdLineIface(templateObj=temp()).run() File "C:\python\lib\site-packages\Cheetah\TemplateCmdLineIface.py", line 44, in run print self._template File "C:\python\lib\site-packages\Cheetah\Template.py", line 997, in __str__ rc = getattr(self, mainMethName)() File "temp.py", line 82, in respond self._handleCheetahInclude("temp.txt", trans=trans, includeFrom="file", raw=False) File "C:\python\lib\site-packages\Cheetah\Template.py", line 1582, in _handleCheetahInclude _globalSetVars=self._CHEETAH__globalSetVars) File "__1_temp_txt.py", line 55, in __init__ NameError: global name '_1_temp_txt__1_temp_txt' is not defined If I move temp.py to c:\1 directory all works fine What did I do wrong? Is this known problem? Thanks, Kirill -------------------------------------------------------------------- Closed Joint Stock Company Intel A/O Registered legal address: Krylatsky Hills Business Park, 17 Krylatskaya Str., Bldg 4, Moscow 121614, Russian Federation This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. |