[ZPT] CVS: Releases/Zope/lib/python/Products/PageTemplates - PageTemplateFile.py:1.7

Evan Simpson evan@zope.com
Thu, 15 Nov 2001 11:38:02 -0500


Update of /cvs-repository/Releases/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv19658

Modified Files:
	PageTemplateFile.py 
Log Message:
Change macro handling and document_src content-type.

=== Releases/Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.6 => 1.7 ===
 from ExtensionClass import Base
 
-class MacroCollection(Base):
-    def __of__(self, parent):
-        parent._cook_check()
-        return parent._v_macros
-
 class PageTemplateFile(Script, PageTemplate, Traversable):
     "Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
      
@@ -116,7 +111,6 @@
     func_code = FuncCode((), 0)
     _need__name__=1
     _v_last_read=0
-    macros = MacroCollection()
 
     _default_bindings = {'name_subpath': 'traverse_subpath'}
 
@@ -173,6 +167,10 @@
         finally:
             security.removeContext(self)
 
+    def pt_macro(self):
+        self._cook_check()
+        return PageTemplate.pt_macro(self)
+
     def _cook_check(self):
         if self._v_last_read and not DevelopmentMode:
             return
@@ -193,7 +191,7 @@
         """Return expanded document source."""
 
         if RESPONSE is not None:
-            RESPONSE.setHeader('Content-Type', self.content_type)
+            RESPONSE.setHeader('Content-Type', 'text/plain')
         return self.read()
 
     def _get__roles__(self):