[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate - PageTemplateFile.py:1.1.2.8 SimpleViewClass.py:1.1.2.2

Jim Fulton jim@zope.com
Thu, 3 Jan 2002 18:48:31 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate
In directory cvs.zope.org:/tmp/cvs-serv15513/PageTemplate

Modified Files:
      Tag: Zope-3x-branch
	PageTemplateFile.py SimpleViewClass.py 
Log Message:
Removed need to pass 'globals()' to PageTemplateFile


=== Zope3/lib/python/Zope/PageTemplate/PageTemplateFile.py 1.1.2.7 => 1.1.2.8 ===
     _default_bindings = {'name_subpath': 'traverse_subpath'}
 
-    def __init__(self, filename, _prefix):
-        assert _prefix is not None
+    def __init__(self, filename, _prefix=None):
+        if _prefix is None:
+            _prefix = sys._getframe(1).f_globals
         if not isinstance(_prefix, str):
             _prefix = package_home(_prefix)
         if not os.path.splitext(filename)[1]:


=== Zope3/lib/python/Zope/PageTemplate/SimpleViewClass.py 1.1.2.1 => 1.1.2.2 ===
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+"""
 
-#XXX
+Revision information: $Id$
+"""
+
+import sys
 from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
 from PageTemplateFile import PageTemplateFile
 
@@ -14,7 +30,9 @@
     def browser_default(self, request):
         return self.index, ()
 
-def SimpleViewClass(src, offering, used_for=None):
+def SimpleViewClass(src, offering=None, used_for=None):
+    if offering is None:
+        offering = sys._getframe(1).f_globals
     
     class C(simple):