[ZPT] PageTemplateFile + METAL don't work + patch

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


You can't use PageTemplateFiles that define METAL macros. It seems they 
never get compiled, so they don't get found at runtime, so you get errors.

The solution is to make sure PageTemplateFiles cook their code on __init__.

Here's a patch against today's CVS. Oh, it includes my last patch in to 
fix "Ambiguous name" errors at start-up too.

*** PageTemplateFile.py.original
--- PageTemplateFile.py.new
***************
*** 128,134 ****
--- 128,136 ----
           if not name:
               name = os.path.split(filename)[-1]
           self.__name__ = name
+         self._need__name__=0
           self.filename = filename = os.path.join(_prefix, filename + 
'.zpt')
+         self._cook_check()

       def pt_getContext(self):
           root = self.getPhysicalRoot()


--
Steve Alexander
Software Engineer
Cat-box limited