[Zope-Checkins] CVS: Zope/lib/python/Products/PageTemplates - ZopePageTemplate.py:1.48

Jim Fulton cvs-admin at zope.org
Fri Nov 28 11:45:53 EST 2003


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

Modified Files:
	ZopePageTemplate.py 
Log Message:
Removed permission requirements for non-existent method.

New-style class dictionaries are immutable. Changed some class-update
code to use setattr rather thah class-dictionary modifications.


=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.47 => 1.48 ===
--- Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py:1.47	Tue Oct 21 11:31:08 2003
+++ Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py	Fri Nov 28 11:45:52 2003
@@ -45,6 +45,23 @@
 except ImportError:
     SUPPORTS_WEBDAV_LOCKS = 0
 
+
+
+class Src(Acquisition.Explicit):
+    " "
+
+    PUT = document_src = Acquisition.Acquired
+    index_html = None
+
+    def __before_publishing_traverse__(self, ob, request):
+        if getattr(request, '_hacked_path', 0):
+            request._hacked_path = 0
+
+    def __call__(self, REQUEST, RESPONSE):
+        " "
+        return self.document_src(REQUEST)
+
+
 class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
                        Traversable, PropertyManager):
     "Zope wrapper for Page Template using TAL, TALES, and METAL"
@@ -94,7 +111,7 @@
     security.declareProtected('View management screens',
       'pt_editForm', 'manage_main', 'read',
       'ZScriptHTML_tryForm', 'PrincipiaSearchSource',
-      'document_src', 'source.html', 'source.xml')
+      'document_src', 'source_dot_xml')
 
     security.declareProtected('FTP access',
       'manage_FTPstat','manage_FTPget','manage_FTPlist')
@@ -104,6 +121,8 @@
     pt_editForm._owner = None
     manage = manage_main = pt_editForm
 
+    source_dot_xml = Src()
+
     security.declareProtected('Change Page Templates',
       'pt_editAction', 'pt_setTitle', 'pt_edit',
       'pt_upload', 'pt_changePrefs')
@@ -294,24 +313,8 @@
         def wl_isLocked(self):
             return 0
 
-
-class Src(Acquisition.Explicit):
-    " "
-
-    PUT = document_src = Acquisition.Acquired
-    index_html = None
-
-    def __before_publishing_traverse__(self, ob, request):
-        if getattr(request, '_hacked_path', 0):
-            request._hacked_path = 0
-
-    def __call__(self, REQUEST, RESPONSE):
-        " "
-        return self.document_src(REQUEST)
-
-d = ZopePageTemplate.__dict__
-d['source.xml'] = d['source.html'] = Src()
-
+setattr(ZopePageTemplate, 'source.xml',  ZopePageTemplate.source_dot_xml)
+setattr(ZopePageTemplate, 'source.html', ZopePageTemplate.source_dot_xml)
 
 # Product registration and Add support
 manage_addPageTemplateForm = PageTemplateFile(




More information about the Zope-Checkins mailing list