[ZPT] Re: ZPT in Python products, and _setName

Steve Alexander steve@cat-box.net
Sat, 13 Oct 2001 20:33:28 +0100


Steve Alexander wrote:

> 
> 
> *** PageTemplateFile.py.original
> --- ./PageTemplateFile.py.new
> ***************
> *** 130,135 ****
> --- 130,139 ----
>           self.__name__ = name
>           self.filename = filename = os.path.join(_prefix, filename + 
> '.zpt')
> 
> +     def _setName(self, name):
> +         self.__name__ = name
> +         self._need__name__ = 0
> +
>       def pt_getContext(self):
>           root = self.getPhysicalRoot()
>           c = {'template': self,


Looking more closely at PageTemplateFile, I can dispense with the need 
for _setName in the circumstances described earlier if I just insert 
this line in the __init__ method:

   self._need__name__ = 0

-- 
Steve Alexander
Software Engineer
Cat-Box limited