[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate - SimplePresentationClass.py:1.1.2.2
Jim Fulton
jim@zope.com
Wed, 28 Nov 2001 16:54:48 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate
In directory cvs.zope.org:/tmp/cvs-serv21232
Modified Files:
Tag: Zope-3x-branch
SimplePresentationClass.py
Log Message:
Fixed bug that caused None to be returned as the class.
=== Zope3/lib/python/Zope/PageTemplate/SimplePresentationClass.py 1.1.2.1 => 1.1.2.2 ===
#XXX
-
+from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
from PageTemplateFile import PageTemplateFile
class simple(object):
+ __implements__=IBrowserPublisher
+
+ # Boiler plate
+ def __init__(self, context): self._context=context
+ def getContext(self): return self._context
+
def browser_default(self, request):
return self.index, ()
-
-
def SimplePresentationClass(src, offering, used_for=None):
class C(simple):
- index=PageTemplateFile(src, offering)
-
-
-
+ if used_for is not None: __used_for__ = used_for
+ index=PageTemplateFile(src, offering)
+
+ return C