[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/Browser - Debug.py:1.1.4.1 Publication.py:1.1.2.9
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:52 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/Browser
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/ZopePublication/Browser
Modified Files:
Tag: Zope-3x-branch
Publication.py
Added Files:
Tag: Zope-3x-branch
Debug.py
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals):
- RenameAllowToRequire
- GroupClassRelatedDirectivesInClassDirective
- ViewInterfaceAndSimplification
- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes
- TwoArgumentViewConstructors
- ImplementsInZCML
- SimpleViewCreationInZCML
- RemoveGetView
- ReplaceProtectWithAllow
- ViewMethodsAsViews
- MergeProtectionAndComponentDefinitions
There were also various security fixes resulting of better integration
of security with components.
=== Added File Zope3/lib/python/Zope/App/ZopePublication/Browser/Debug.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""Zope 3 debugger
This is the first preliminary (add weasle words) cut at a zope debugger.
$Id: Debug.py,v 1.1.4.1 2002/06/07 14:41:21 jim Exp $
"""
__metaclass__ = type # All classes are new style when run with Python 2.2+
from Zope.Publisher.Publish import publish as _publish
from Zope.App.ZopePublication.Browser.Publication import BrowserPublication
from ZODB.FileStorage import FileStorage
from ZODB.DB import DB
from Zope.Publisher.Browser.BrowserRequest import TestRequest
from Zope.Configuration.xmlconfig import XMLConfig
from cStringIO import StringIO
import base64
XMLConfig('../../site.zcml')()
db= DB(FileStorage('../../Data.fs'))
pub = BrowserPublication(db)
def publish(path='/', stdin='', basic=None, **kw):
out = StringIO()
if type(stdin) is str:
stdin = StringIO(stdin)
env = {'PATH_INFO': path}
env.update(kw)
if basic:
env['HTTP_AUTHORIZATION']="Basic %s" % base64.encodestring(basic)
request = TestRequest(StringIO(''), StringIO(), env)
request.setPublication(pub)
_publish(request, 0)
=== Zope3/lib/python/Zope/App/ZopePublication/Browser/Publication.py 1.1.2.8 => 1.1.2.9 ===
from Zope.App.ZopePublication.HTTP.Publication import ZopeHTTPPublication
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
-from Zope.ComponentArchitecture import getRequestView
+from Zope.ComponentArchitecture import queryView
from Zope.Proxy.ContextWrapper import ContextWrapper
from Zope.Proxy.ProxyIntrospection import removeAllProxies
@@ -33,7 +33,7 @@
if IBrowserPublisher.isImplementedBy(removeAllProxies(ob)):
r = ob.browserDefault(request)
else:
- adapter = getRequestView(ob, '_traverse', request , None)
+ adapter = queryView(ob, '_traverse', request , None)
if adapter is not None:
r = adapter.browserDefault(request)
else: