[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/PageTemplate - SimpleViewClass.py:1.1.2.1.4.2
Jim Fulton
jim@zope.com
Sun, 2 Jun 2002 10:35:22 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/PageTemplate
In directory cvs.zope.org:/tmp/cvs-serv29793/lib/python/Zope/App/PageTemplate
Modified Files:
Tag: Zope3InWonderland-branch
SimpleViewClass.py
Log Message:
- Added template attribute to allow views to be created from a
template source file.
- Added beginnings of a Zope debugger. This required seperating site
and server configuration.
- Added the ability to specify a config file package in the
zopeConfigure directive. Made "config.zcml" a default for the file
attribute in the include directive.
- Fixed mapply to unwrap proxied objects. This was necessary once
views became wrapped in proxies. We need to investigate why they
weren't being wrapped before.
- I updated enough system page templates and zcml directives so that:
- Zope now starts. :)
- The root folder contents listing can be viewed.
Many more templates and zcml files need to be updated to reflect the
way views are now handled.
=== Zope3/lib/python/Zope/App/PageTemplate/SimpleViewClass.py 1.1.2.1.4.1 => 1.1.2.1.4.2 ===
raise NotFound(self, name, request)
-
# XXX: we need some unittests for this !!!
def __getitem__(self, name):
return self.index.macros[name]
- def __call__(self, REQUEST, *args, **kw):
- return self.index(REQUEST, *args, **kw)
+ def __call__(self, *args, **kw):
+ return self.index(self.request, *args, **kw)
def SimpleViewClass(src, offering=None, used_for=None):
if offering is None:
offering = sys._getframe(1).f_globals
- class_ = type(src, (simple,),
+ class_ = type("SimpleViewClass from %s" % src, (simple,),
{'index': ViewPageTemplateFile(src, offering)})
if used_for is not None:
class_.__used_for__ = used_for
-
- defineChecker(class_, NamesChecker('index'))
return class_