NameError when generating Python code

Martin Skøtt <[email protected]>
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
Hi,

I'm trying to use Cheetah 2.1.0.1 to generate some Python stub classes, but
I have encountered a problem which to me looks like Cheetah is actually
evaluating the code I generate. Here is the error I get: (Python 2.6 on Win
XP):
Traceback (most recent call last):
  File "stubGen.py", line 64, in <module>
    print(t)
  File "C:\Python26\Lib\site-packages\Cheetah\Template.py", line 982, in
__str__
    def __str__(self): return getattr(self, mainMethName)()
  File "_HOME_Generator_src_templates_class_tmpl.py", line 89, in respond
NameError: global name 'BaseClass' is not defined

Here is the template I'm using:
from BaseClass import BaseClass
class $module.module(BaseClass):
    pass

If I comment out (##) the two first lines it works fine. Any suggestions on
how to solve this?

Regards,
Martin

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.