[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate - SimpleViewClass.py:1.1.2.1 PageTemplate.py:1.1.2.5 __init__.py:1.1.2.5 SimplePresentationClass.py:NONE
Fred Drake Jr
fdrake@acm.org
Wed, 12 Dec 2001 15:40:33 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate
In directory cvs.zope.org:/tmp/cvs-serv15563/Zope/PageTemplate
Modified Files:
Tag: Zope-3x-branch
PageTemplate.py __init__.py
Added Files:
Tag: Zope-3x-branch
SimpleViewClass.py
Removed Files:
Tag: Zope-3x-branch
SimplePresentationClass.py
Log Message:
Presentation --> View
=== Added File Zope3/lib/python/Zope/PageTemplate/SimpleViewClass.py ===
#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 SimpleViewClass(src, offering, used_for=None):
class C(simple):
if used_for is not None: __used_for__ = used_for
index=PageTemplateFile(src, offering)
return C
=== Zope3/lib/python/Zope/PageTemplate/PageTemplate.py 1.1.2.4 => 1.1.2.5 ===
from Zope.TAL.TALGenerator import TALGenerator
from Zope.TAL.TALInterpreter import TALInterpreter
-from Zope.ComponentArchitecture import getPresentation
+from Zope.ComponentArchitecture import getView
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
from Expressions import getEngine
from string import join, strip, rstrip, split, replace, lower, find
@@ -58,7 +58,7 @@
'modules': ModuleImporter,
}
## if inst is not None:
-## c['presentation'] = PresentationMapper(inst.getContext())
+## c['views'] = ViewMapper(inst.getContext())
## c['here'] = inst.getContext()
## c['container'] = inst
# XXX this needs to be changed when we have context
@@ -87,7 +87,7 @@
extra_context = {'options': kwargs}
if inst is not None:
extra_context['here'] = inst.getContext()
- extra_context['presentation'] = PresentationMapper(inst.getContext())
+ extra_context['views'] = ViewMapper(inst.getContext())
extra_context['container'] = inst
return self.pt_render(extra_context=extra_context)
@@ -175,12 +175,12 @@
return "<BoundPageTemplateFile of %r>" % self.im_self
-class PresentationMapper:
+class ViewMapper:
def __init__(self, ob):
self.ob = ob
def __getitem__(self, name):
- return getPresentation(self.ob, name, IBrowserPublish)
+ return getView(self.ob, name, IBrowserPublish)
class _ModuleImporter:
=== Zope3/lib/python/Zope/PageTemplate/__init__.py 1.1.2.4 => 1.1.2.5 ===
"""Page Templates for Zope 3."""
-from SimplePresentationClass import SimplePresentationClass
+from SimpleViewClass import SimpleViewClass
from PageTemplateFile import PageTemplateFile
=== Removed File Zope3/lib/python/Zope/PageTemplate/SimplePresentationClass.py ===