[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS - ContainerTraverser.py:1.1.2.1 RootFolder.py:1.1.2.5
Shane Hathaway
shane@digicool.com
Tue, 20 Nov 2001 14:37:34 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS
In directory cvs.zope.org:/tmp/cvs-serv23524/lib/python/Zope/App/OFS
Modified Files:
Tag: Zope-3x-branch
RootFolder.py
Added Files:
Tag: Zope-3x-branch
ContainerTraverser.py
Log Message:
- Stitched together container presentation.
- Changed signature of browser_default and NotFound.
=== Added File Zope3/lib/python/Zope/App/OFS/ContainerTraverser.py ===
# This software is subject to the provisions of the Zope Public License,
# Version 1.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
"""
Define presentation component for folder contents.
"""
import os
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
from Zope.Publisher.Exceptions import NotFound
from IContainer import IReadContainer
from Zope.ComponentArchitecture import getPresentation
class ContainerTraverser:
__implements__ = IBrowserPublisher
__used_for__ = IReadContainer
def __init__(self, c):
self._c = c
def browser_traverse(self, request, name):
c = self._c
if name[-5:] == ';view':
p = getPresentation(c, name[:-5], IBrowserPublisher)
if p is None:
raise NotFound(c, name, request)
else:
return p
subob = c.getObject(name, None)
if subob is None:
raise NotFound(c, name, request)
return subob
def browser_default(self, request):
"""
"""
c = self._c
p = getPresentation(c, '', IBrowserPublisher)
if p is None:
raise PresentationNotFound
return p.browser_default(request)
=== Zope3/lib/python/Zope/App/OFS/RootFolder.py 1.1.2.4 => 1.1.2.5 ===
+#
# This software is subject to the provisions of the Zope Public License,
# Version 1.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED