Commit 9c0bd8ee authored by Hanno Schlichting's avatar Hanno Schlichting

Caught up with the latest and greatest from the Zope Toolkit again

parent a7556c1e
......@@ -25,7 +25,6 @@ eggs =
zope.container
zope.contentprovider
zope.contenttype
zope.copypastemove
zope.datetime
zope.deferredimport
zope.deprecation
......@@ -49,7 +48,6 @@ eggs =
zope.publisher
zope.schema
zope.security
zope.securitypolicy
zope.sendmail
zope.sequencesort
zope.session
......
[buildout]
extends = alltests.cfg
parts += dependencies
[dependencies]
recipe = z3c.recipe.depgraph
eggs = ${alltests:eggs}
variants = base tred
exclude =
ClientForm
docutils
mechanize
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
<interface
interface="zope.publisher.interfaces.browser.IBrowserSkinType"
/>
<interface
interface="zope.app.publisher.interfaces.browser.IMenuItemType"
/>
......
......@@ -43,7 +43,7 @@ def test_recursion():
>>> from zope.component import provideAdapter
>>> from zope.publisher.interfaces.browser import IBrowserRequest
>>> from zope.component.interfaces import IDefaultViewName
>>> from zope.publisher.interfaces import IDefaultViewName
>>> provideAdapter(u'view', (IRecurse, IBrowserRequest), IDefaultViewName)
Here comes the actual test:
......
......@@ -6,6 +6,7 @@
<include file="i18n.zcml" />
<include file="event.zcml"/>
<include file="deprecated.zcml"/>
<include file="publisher.zcml"/>
<include file="traversing.zcml"/>
<include package=".component" />
<include package=".browser" />
......
<configure xmlns="http://namespaces.zope.org/zope">
<interface interface="zope.publisher.interfaces.browser.IBrowserSkinType" />
<interface
interface="zope.publisher.interfaces.browser.IDefaultBrowserLayer"
type="zope.publisher.interfaces.browser.IBrowserSkinType"
/>
<class class="ZPublisher.HTTPRequest.HTTPRequest">
<implements
interface="zope.annotation.interfaces.IAttributeAnnotatable"
/>
</class>
<adapter
name="default"
factory="zope.publisher.browser.getDefaultSkin"
for="zope.publisher.interfaces.browser.IBrowserRequest"
provides="zope.publisher.interfaces.IDefaultSkin"
/>
</configure>
......@@ -16,21 +16,17 @@ $Id$
"""
from urllib import quote as urllib_quote
import xmlrpc
from zExceptions import Forbidden, Unauthorized, NotFound
from zExceptions import Forbidden, NotFound
from Acquisition import aq_base
from Acquisition.interfaces import IAcquirer
from zope.interface import implements, providedBy, Interface
from zope.interface import implements, Interface
from zope.component import queryMultiAdapter
from zope.component import getSiteManager
from zope.component.interfaces import ComponentLookupError
from zope.event import notify
from zope.app.publication.interfaces import EndRequestEvent
from zope.app.publisher.browser import queryDefaultViewName
from zope.publisher.interfaces import IPublishTraverse
from zope.component.interfaces import IDefaultViewName
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.traversing.interfaces import TraversalError
from zope.traversing.namespace import nsParse, namespaceLookup
......@@ -42,6 +38,7 @@ def quote(text):
try:
from ExtensionClass import Base
from ZPublisher.Converters import type_converters
class RequestContainer(Base):
__roles__=None
def __init__(self,**kw):
......
......@@ -21,7 +21,8 @@ from Request import Request
from maybe_lock import allocate_lock
from mapply import mapply
from zExceptions import Redirect
from zope.publisher.browser import setDefaultSkin
from zope.publisher.interfaces import ISkinnable
from zope.publisher.skinnable import setDefaultSkin
from zope.security.management import newInteraction, endInteraction
class Retry(Exception):
......@@ -164,8 +165,10 @@ def publish(request, module_name, after_list, debug=0,
# Only reachable if Retry is raised and request supports retry.
newrequest=request.retry()
request.close() # Free resources held by the request.
# Set the default layer/skin on the newly generated request
setDefaultSkin(newrequest)
if ISkinnable.providedBy(newrequest):
setDefaultSkin(newrequest)
try:
return publish(newrequest, module_name, after_list, debug)
finally:
......@@ -199,7 +202,8 @@ def publish_module_standard(module_name,
# make sure that the request we hand over has the
# default layer/skin set on it; subsequent code that
# wants to look up views will likely depend on it
setDefaultSkin(request)
if ISkinnable.providedBy(request):
setDefaultSkin(request)
response = publish(request, module_name, after_list, debug=debug)
except SystemExit, v:
......
......@@ -195,8 +195,10 @@ def publish_module(module_name,
# make sure that the request we hand over has the
# default layer/skin set on it; subsequent code that
# wants to look up views will likely depend on it
from zope.publisher.browser import setDefaultSkin
setDefaultSkin(request)
from zope.publisher.interfaces import ISkinnable
from zope.publisher.skinnable import setDefaultSkin
if ISkinnable.providedBy(request):
setDefaultSkin(request)
for k, v in extra.items(): request[k]=v
response = publish(request, module_name, after_list, debug=debug)
......
......@@ -518,7 +518,7 @@ class TestBaseRequestZope3Views(unittest.TestCase, BaseRequest_factory):
def _setDefaultViewName(self, name):
from zope.component import getGlobalSiteManager
from zope.component.interfaces import IDefaultViewName
from zope.publisher.interfaces import IDefaultViewName
from zope.publisher.browser import IBrowserRequest
gsm = getGlobalSiteManager()
gsm.registerAdapter(name, (self._dummyInterface(), IBrowserRequest),
......
from zope.publisher.browser import setDefaultSkin
from zope.interface import implements
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.skinnable import setDefaultSkin
from ZPublisher import Retry
from ZODB.POSException import ConflictError
......@@ -89,6 +91,8 @@ class Request:
"""Mock Request to replace ZPublisher.HTTPRequest.HTTPRequest.
"""
implements(IBrowserRequest)
args = ()
def __init__(self):
......
......@@ -16,14 +16,15 @@ import sys
import unittest
import logging
from zope.interface.common.interfaces import IException
from zope.publisher.skinnable import setDefaultSkin
from zope.publisher.interfaces import INotFound
from zope.security.interfaces import IUnauthorized
from zope.security.interfaces import IForbidden
from zope.interface.common.interfaces import IException
from zope.app.testing import ztapi
from zope.app.testing.placelesssetup import PlacelessSetup
from zope.publisher.browser import setDefaultSkin
class ExceptionHookTestCase(unittest.TestCase):
......@@ -162,7 +163,6 @@ class ExceptionHookTest(ExceptionHookTestCase):
getConfiguration().conflict_error_log_level = old_value
def testConflictErrorCount(self):
from ZPublisher import Retry
from ZODB.POSException import ConflictError
def f():
raise ConflictError
......@@ -397,7 +397,6 @@ class ExceptionViewsTest(PlacelessSetup, ExceptionHookTestCase):
self.failUnless("Exception View: InternalError" in str(v), v)
def testRedirectNoExceptionView(self):
from ZPublisher.HTTPResponse import HTTPResponse
from zExceptions import Redirect
ztapi.browserView(IException, u'index.html', CustomExceptionView)
def f():
......
......@@ -24,62 +24,63 @@ transaction = 1.0a1
zc.buildout = 1.2.1
zc.lockfile = 1.0.0
zc.recipe.egg = 1.2.2
zc.recipe.testrunner = 1.1.0
zc.recipe.testrunner = 1.2.0
zdaemon = 2.0.4
zodbcode = 3.4.0
zope.annotation = 3.4.1
zope.app.apidoc = 3.6.1
zope.annotation = 3.4.2
zope.app.apidoc = 3.6.2
zope.app.applicationcontrol = 3.4.3
zope.app.appsetup = 3.9.0
zope.app.authentication = 3.5.0a2
zope.app.appsetup = 3.10.1
zope.app.basicskin = 3.4.0
zope.app.broken = 3.5.0
zope.app.cache = 3.5.0
zope.app.catalog = 3.8.0
zope.app.component = 3.6.0
zope.app.container = 3.7.1
zope.app.component = 3.7.0
zope.app.container = 3.7.2
zope.app.content = 3.4.0
zope.app.dav = 3.5.0
zope.app.debug = 3.4.1
zope.app.dependable = 3.4.0
zope.app.dtmlpage = 3.5.0
zope.app.error = 3.5.2
zope.app.exception = 3.4.2
zope.app.exception = 3.5.0
zope.app.file = 3.5.0
zope.app.folder = 3.5.0
zope.app.form = 3.7.1
zope.app.generations = 3.4.2
zope.app.http = 3.5.0
zope.app.i18n = 3.5.0
zope.app.folder = 3.5.1
zope.app.form = 3.7.2
zope.app.generations = 3.5.0
zope.app.http = 3.5.2
zope.app.i18n = 3.6.0
zope.app.interface = 3.4.0
zope.app.intid = 3.7.0
zope.app.locales = 3.5.1
zope.app.localpermission = 3.7.0
zope.app.pagetemplate = 3.5.0
zope.app.principalannotation = 3.5.0
zope.app.publication = 3.5.1
zope.app.publisher = 3.6.0
zope.app.principalannotation = 3.6.1
zope.app.publication = 3.5.3
zope.app.publisher = 3.6.2
zope.app.renderer = 3.5.0
zope.app.schema = 3.5.0
zope.app.security = 3.6.0
zope.app.security = 3.7.0
zope.app.securitypolicy = 3.5.1
zope.app.server = 3.4.2
zope.app.session = 3.6.0
zope.app.testing = 3.6.0
zope.app.testing = 3.6.2
zope.app.traversing = 3.4.0
zope.app.undo = 3.5.0
zope.app.wsgi = 3.4.1
zope.app.wsgi = 3.5.2
zope.app.zapi = 3.4.0
zope.app.zcmlfiles = 3.5.2
zope.app.zopeappgenerations = 3.4.0
zope.app.zcmlfiles = 3.5.3
zope.app.zopeappgenerations = 3.5.0
zope.app.zptpage = 3.5.0
zope.authentication = 3.7.0
zope.broken = 3.5.0
zope.browser = 0.5.0
zope.cachedescriptors = 3.4.1
zope.cachedescriptors = 3.5.0
zope.catalog = 3.8.0
zope.component = 3.5.1
zope.component = 3.6.0
zope.configuration = 3.6.0
zope.container = 3.7.1
zope.contentprovider = 3.4.0
zope.container = 3.8.1
zope.contentprovider = 3.5.0
zope.contenttype = 3.4.1
zope.copy = 3.5.0
zope.copypastemove = 3.5.1
......@@ -91,26 +92,28 @@ zope.documenttemplate = 3.4.2
zope.dottedname = 3.4.5
zope.dublincore = 3.4.2
zope.error = 3.6.0
zope.event = 3.4.0
zope.event = 3.4.1
zope.exceptions = 3.5.2
zope.filerepresentation = 3.5.0
zope.formlib = 3.5.2
zope.hookable = 3.4.1
zope.i18n = 3.6.0
zope.i18n = 3.7.0
zope.i18nmessageid = 3.4.3
zope.index = 3.5.1
zope.interface = 3.5.0
zope.interface = 3.5.1
zope.intid = 3.7.0
zope.keyreference = 3.6.1
zope.lifecycleevent = 3.5.0
zope.lifecycleevent = 3.5.1
zope.location = 3.5.3
zope.minmax = 1.1.0
zope.pagetemplate = 3.4.1
zope.password = 3.5.1
zope.pagetemplate = 3.4.2
zope.principalannotation = 3.6.0
zope.proxy = 3.5.0
zope.publisher = 3.5.7
zope.schema = 3.5.2
zope.publisher = 3.6.4
zope.schema = 3.5.4
zope.security = 3.6.3
zope.securitypolicy = 3.5.0
zope.securitypolicy = 3.6.0
zope.sendmail = 3.5.1
zope.sequencesort = 3.4.0
zope.server = 3.5.0
......@@ -121,6 +124,6 @@ zope.structuredtext = 3.4.0
zope.tal = 3.5.1
zope.tales = 3.4.0
zope.testbrowser = 3.6.0a2
zope.testing = 3.7.1
zope.traversing = 3.5.2
zope.testing = 3.7.3
zope.traversing = 3.6.0
zope.viewlet = 3.5.0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment