Re: [Cheetahtemplate-discuss] Quickstart tutorial problem WinXP
Brought to you by:
rtyler,
tavis_rudd
From: Mike D. <mi...@de...> - 2006-04-24 08:20:56
|
Sorry - should have mentioned Cheetah 2.0rc6 with version 1.0 docs Mike Dewhirst wrote: > Mike Dewhirst wrote: >> I'm trying to work through the 3.7 Quickstart tutorial on pages 14 and >> 15 of the manual. Windows XP. >> >> It works up to a point but falls over with a "NameMapper.NotFound" error. >> >> I don't think I mistyped anything and the session with the error is >> shown below. After the error I added an extra parameter to make it >> similar to the first example and there was no apparent problem. I >> suspect the tutorial was trying to demonstrate something else. >> >> I'll try the same thing on Linux and see. > > It behaves identically on Linux. > > I must be making the same mistake. > > Mike > >> >> Any ideas? >> >> Mike >> >> C:\test\cheetah>python >> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] >> on win32 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> from Cheetah.Template import Template >> >>> templateDef = """ >> ... <html> >> ... <head><title>$title</title></head> >> ... <body> >> ... $contents >> ... </body> >> ... </html>""" >> >>> nameSpace = {'title': 'Hello World Example', 'contents': 'Hello >> World'} >> >>> t1 = Template(templateDef, searchList=[nameSpace]) >> >>> print t1 >> >> <html> >> <head><title>Hello World Example</title></head> >> <body> >> Hello World >> </body> >> </html> >> >>> >> >>> >> >>> class Template3(Template): >> ... title = 'HW Example' >> ... contents = 'H3llo World' >> ... >> >>> t3 = Template3(templateDef) >> >>> print t3 >> Traceback (most recent call last): >> File "<stdin>", line 1, in ? >> File "C:\usr\bin\Lib\site-packages\Cheetah\Template.py", line 995, >> in __str__ >> def __str__(self): return getattr(self, mainMethName)() >> File "DynamicallyCompiledCheetahTemplate.py", line 87, in respond >> NameMapper.NotFound: cannot find 'title' >> >>> >> >>> t3 = Template3(templateDef, searchList=[nameSpace]) >> >>> print t3 >> >> <html> >> <head><title>Hello World Example</title></head> >> <body> >> Hello World >> </body> >> </html> >> >>> >> >> >> ------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job >> easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Cheetahtemplate-discuss mailing list >> Che...@li... >> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss >> >> > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Cheetahtemplate-discuss mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss > > |