Commit 420cfb62 authored by Fred Drake's avatar Fred Drake

- add back _need__name__; it's used by InitializeClass

- normalize whitespace
parent 90a2fe35
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Zope object encapsulating a Page Template from the filesystem. Zope object encapsulating a Page Template from the filesystem.
""" """
__version__='$Revision: 1.27 $'[11:-2] __version__ = '$Revision: 1.28 $'[11:-2]
import os, AccessControl import os, AccessControl
from Globals import package_home, DevelopmentMode from Globals import package_home, DevelopmentMode
...@@ -37,7 +37,11 @@ class PageTemplateFile(Script, PageTemplate, Traversable): ...@@ -37,7 +37,11 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
func_defaults = None func_defaults = None
func_code = FuncCode((), 0) func_code = FuncCode((), 0)
_v_last_read=0 _v_last_read = 0
# needed by App.class_init.default__class_init__, often imported
# using the alias Globals.InitializeClass
_need__name__ = 1
_default_bindings = {'name_subpath': 'traverse_subpath'} _default_bindings = {'name_subpath': 'traverse_subpath'}
...@@ -54,6 +58,7 @@ class PageTemplateFile(Script, PageTemplate, Traversable): ...@@ -54,6 +58,7 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
name = kw.get('__name__') name = kw.get('__name__')
basepath, ext = os.path.splitext(filename) basepath, ext = os.path.splitext(filename)
if name: if name:
self._need__name__ = 0
self.__name__ = name self.__name__ = name
else: else:
self.__name__ = os.path.basename(basepath) self.__name__ = os.path.basename(basepath)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment