[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - viewmeta.py:1.23

Jim Fulton jim@zope.com
Fri, 2 May 2003 14:27:08 -0400


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv30457/publisher/browser

Modified Files:
	viewmeta.py 
Log Message:
Added check that template exists and caused fiven template names to be
converted to absolute paths so that they don't run afoul of zpt source
file path computation.


=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.22 => 1.23 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.22	Thu May  1 15:35:27 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py	Fri May  2 14:27:07 2003
@@ -128,7 +128,7 @@
                 "A class must be provided if attribute is used")
 
     if template:
-        template = str(_context.path(template))
+        template = os.path.abspath(str(_context.path(template)))
         if not os.path.isfile(template):
             raise ConfigurationError("No such file", template)
         required['__getitem__'] = permission
@@ -143,7 +143,6 @@
                     )
         if template:
             # class and template
-            template = str(_context.path(template))
             new_class = SimpleViewClass(
                 template, bases=(original_class, ), usage=usage
                 )
@@ -274,7 +273,7 @@
 
     def page(self, _context, name, attribute=None, template=None, usage=None):
         if template:
-            template = _context.path(template)
+            template = os.path.abspath(_context.path(template))
             if not os.path.isfile(template):
                 raise ConfigurationError("No such file", template)
         else: