[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - viewmeta.py:1.7
Jim Fulton
jim@zope.com
Tue, 31 Dec 2002 15:15:52 -0500
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv2199
Modified Files:
viewmeta.py
Log Message:
Added a hack to work around a wart in my recent refactoring. I'll sort
this out correctly after the first alpha release.
=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.6 Tue Dec 31 13:26:58 2002
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py Tue Dec 31 15:15:52 2002
@@ -55,7 +55,7 @@
# name="info.html"
# template="info.pt"
# class=".ContactInfoView."
-# permission="Zope.View"
+# permission="zope.View"
# />
#
# Unamed view with pages (multi-page view)
@@ -288,13 +288,20 @@
pages[pname] = attribute
if hasattr(class_, 'publishTraverse'):
+
+ # XXX This context trickery is a hack around a problem, I
+ # can't fix till after the alpha. :(
+
def publishTraverse(self, request, name,
pages=pages, getattr=getattr):
if name in pages:
return getattr(self, pages[name])
-
- return class_.publishTraverse(self, request, name)
+
+ m = class_.publishTraverse.__get__(self)
+ return m(request, name)
+
+ publishTraverse = ContextMethod(publishTraverse)
else:
def publishTraverse(self, request, name,
@@ -351,15 +358,15 @@
def addview(_context, name, permission,
layer='default', class_=None,
- allowed_interface=None, allowed_attributes=None,
+ allowed_interface='', allowed_attributes='',
menu=None, title=None,
):
return view(_context, name,
'zope.app.interfaces.container.IAdding',
permission,
- layer='default', class_=None,
- allowed_interface=None, allowed_attributes=None,
- menu=None, title=None,
+ layer, class_,
+ allowed_interface, allowed_attributes,
+ menu, title,
)
addview.__implements__ = INonEmptyDirective