Re: [Cheetahtemplate-discuss] Cheetah 0.9.16 and inheritance
Brought to you by:
rtyler,
tavis_rudd
From: Tavis R. <ta...@re...> - 2005-05-18 07:26:06
|
I've just added a new test case to our test suite to guard against these two in the future. On Friday 13 May 2005 02:48, Brian Bird wrote: > Thanks - unfortunately it now seems to cause a problem with "#set global": > Changing test.py to this: > > from Cheetah import Template > source="""#extends parent > #set global g="Hello" > #implements respond > I am a child > The value is $g > > Now gives: NameMapper.NotFound: cannot find 'g' > > Using just #set g="Hello" works fine though. This wasn't a problem in > 0.9.16 > > I'm very wary about trying to actually fix the code itself (since I'll > happily admit I don't fully understand NameMapper.py!), but if you think it > will be any use I could write some tests for these cases so they can be > included in the "cheetah test" script? > > Although they might be considered acceptance or functional tests rather > than unittests, but I don't know if there is any particular structure for > these things? > > Thanks, > > Brian > > > -----Original Message----- > From: che...@li... > [mailto:che...@li...] On Behalf Of > Tavis Rudd > Sent: 12 May 2005 22:10 > To: che...@li... > Cc: Brian Bird > Subject: Re: [Cheetahtemplate-discuss] Cheetah 0.9.16 and inheritance > > fixed in the cvs. 0.9.17-rc1 is coming soon. > > On Tuesday 10 May 2005 02:11, Brian Bird wrote: > > I think I may have found a problem with Cheetah 0.9.16 with > > inheritance (the same behaviour happens with the latest cvs code): > > > > Create and compile a file "parent.tmpl" with no contents (or any > > content). Create the following test.py and execute it: > > > > from Cheetah import Template > > source="""#extends parent > > #implements respond > > I am a child > > The value is $key > > """ > > print Template.Template(source=source, searchList=[{"key":"value"}]) > > > > In cheetah 0.9.15, this outputs (as expected): > > I am a child > > The value is value > > > > In cheetah 0.9.16 we get: > > NameMapper.NotFound: cannot find 'key' > > > > Some investigation suggests that with 0.9.16 the self._searchList gets > > overwritten because the order of the compilation is opposite to that > > in 0.9.15. I assume that the searchList is always supposed to be > > available to both the child and the parent? > > > > If you remove the "#extends parent" line it works again, so the > > problem only seems to exist with inheritance. I can reproduce the same > > thing without using "#implements respond" but the example gets more > > complicated so I don't think it's to do with that. > > > > I'm using Suse Linux 9.2 and Python 2.3.3. > > > > Any ideas? Or am I being really stupid? > > > > Thanks, > > Brian > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the > first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Cheetahtemplate-discuss mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Cheetahtemplate-discuss mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss |