Commit a827bf6c authored by Hanno Schlichting's avatar Hanno Schlichting

Follow the zope.app.publisher refactoring - be gone!

parent b3f9ecc7
...@@ -28,7 +28,7 @@ Zope2 depends on the following zope.app packages directly: ...@@ -28,7 +28,7 @@ Zope2 depends on the following zope.app packages directly:
o Products.Five.component (for ``IBeginRequestEvent``, o Products.Five.component (for ``IBeginRequestEvent``,
``IEndRequestEvent``, and ``BeforeTraverseEvent``.) ``IEndRequestEvent``, and ``BeforeTraverseEvent``.)
- [_] zope.app.publisher - [X] zope.app.publisher
* ZPublisher.BaseRequest * ZPublisher.BaseRequest
o Products.Five.browser.adding (for ``getMenu``) o Products.Five.browser.adding (for ``getMenu``)
o Products/Five/browser/configure.zcml (for ``IMenuItemType``, o Products/Five/browser/configure.zcml (for ``IMenuItemType``,
......
...@@ -61,7 +61,8 @@ eggs = ...@@ -61,7 +61,8 @@ eggs =
zope.structuredtext zope.structuredtext
zope.tal zope.tal
zope.tales zope.tales
zope.testbrowser # XXX The testbrowser tests currently fail on its trunk
# zope.testbrowser
zope.thread zope.thread
zope.traversing zope.traversing
zope.viewlet zope.viewlet
......
...@@ -52,6 +52,7 @@ Features Added ...@@ -52,6 +52,7 @@ Features Added
- zope.app.form = 3.8.1 - zope.app.form = 3.8.1
- zope.app.i18n = 3.6.1 - zope.app.i18n = 3.6.1
- zope.app.publication = 3.8.1 - zope.app.publication = 3.8.1
- zope.app.publisher = 3.9.0
- zope.app.renderer = 3.5.1 - zope.app.renderer = 3.5.1
- zope.app.security = 3.7.1 - zope.app.security = 3.7.1
- zope.app.testing = 3.7.1 - zope.app.testing = 3.7.1
...@@ -60,14 +61,17 @@ Features Added ...@@ -60,14 +61,17 @@ Features Added
- zope.browsermenu = 3.9.0 - zope.browsermenu = 3.9.0
- zope.browserresource = 3.9.0 - zope.browserresource = 3.9.0
- zope.component = 3.7.1 - zope.component = 3.7.1
- zope.container = 3.9.0
- zope.i18nmessageid = 3.5.0 - zope.i18nmessageid = 3.5.0
- zope.index = 3.6.0 - zope.index = 3.6.0
- zope.location = 3.6.0 - zope.location = 3.6.0
- zope.ptresource = 3.9.0 - zope.ptresource = 3.9.0
- zope.publisher = 3.9.0
- zope.securitypolicy = 3.6.1 - zope.securitypolicy = 3.6.1
- zope.server = 3.6.0 - zope.server = 3.6.0
- zope.site = 3.6.2 - zope.site = 3.6.2
- zope.testing = 3.8.1 - zope.testing = 3.8.1
- zope.traversing = 3.7.2
- zope.viewlet = 3.6.1 - zope.viewlet = 3.6.1
Bugs Fixed Bugs Fixed
......
...@@ -99,6 +99,9 @@ params = dict(name='Zope2', ...@@ -99,6 +99,9 @@ params = dict(name='Zope2',
'tempstorage', 'tempstorage',
'transaction', 'transaction',
'zdaemon', 'zdaemon',
'zope.browsermenu',
'zope.browserpage',
'zope.browserresource',
'zope.component', 'zope.component',
'zope.configuration', 'zope.configuration',
'zope.container', 'zope.container',
...@@ -116,6 +119,7 @@ params = dict(name='Zope2', ...@@ -116,6 +119,7 @@ params = dict(name='Zope2',
'zope.pagetemplate', 'zope.pagetemplate',
'zope.processlifetime', 'zope.processlifetime',
'zope.proxy', 'zope.proxy',
'zope.ptresource',
'zope.publisher', 'zope.publisher',
'zope.schema', 'zope.schema',
'zope.security', 'zope.security',
...@@ -132,7 +136,6 @@ params = dict(name='Zope2', ...@@ -132,7 +136,6 @@ params = dict(name='Zope2',
'zope.viewlet', 'zope.viewlet',
'zope.app.form', 'zope.app.form',
'zope.app.publication', 'zope.app.publication',
'zope.app.publisher',
'zope.app.schema', 'zope.app.schema',
], ],
......
...@@ -23,8 +23,8 @@ $Id$ ...@@ -23,8 +23,8 @@ $Id$
__docformat__ = 'restructuredtext' __docformat__ = 'restructuredtext'
from zope.app.publisher.browser.menu import getMenu
from zope.browser.interfaces import IAdding from zope.browser.interfaces import IAdding
from zope.browsermenu.menu import getMenu
from zope.component import getMultiAdapter from zope.component import getMultiAdapter
from zope.component import getUtility from zope.component import getUtility
from zope.component import queryMultiAdapter from zope.component import queryMultiAdapter
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
xmlns:browser="http://namespaces.zope.org/browser"> xmlns:browser="http://namespaces.zope.org/browser">
<interface <interface
interface="zope.app.publisher.interfaces.browser.IMenuItemType" interface="zope.browsermenu.interfaces.IMenuItemType"
/> />
<browser:page <browser:page
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
for="*" for="*"
name="view_get_menu" name="view_get_menu"
permission="zope.Public" permission="zope.Public"
class="zope.app.publisher.browser.menu.MenuAccessView" class="zope.browsermenu.menu.MenuAccessView"
allowed_interface="zope.app.publisher.interfaces.browser.IMenuAccessView" allowed_interface="zope.browsermenu.interfaces.IMenuAccessView"
/> />
</configure> </configure>
...@@ -19,6 +19,6 @@ import zope.deferredimport ...@@ -19,6 +19,6 @@ import zope.deferredimport
zope.deferredimport.deprecated( zope.deferredimport.deprecated(
"The Five specific view has been made obsolete. Please use the " "The Five specific view has been made obsolete. Please use the "
"view from zope.app.publisher directly.", "view from zope.browsermenu directly.",
MenuAccessView = 'zope.app.publisher.browser.menu.MenuAccessView', MenuAccessView = 'zope.browsermenu.menu.MenuAccessView',
) )
...@@ -8,33 +8,33 @@ ...@@ -8,33 +8,33 @@
<meta:directive <meta:directive
name="menu" name="menu"
schema="zope.app.publisher.browser.metadirectives.IMenuDirective" schema="zope.browsermenu.metadirectives.IMenuDirective"
handler="zope.app.publisher.browser.menumeta.menuDirective" handler="zope.browsermenu.metaconfigure.menuDirective"
/> />
<meta:complexDirective <meta:complexDirective
name="menuItems" name="menuItems"
schema="zope.app.publisher.browser.metadirectives.IMenuItemsDirective" schema="zope.browsermenu.metadirectives.IMenuItemsDirective"
handler="zope.app.publisher.browser.menumeta.menuItemsDirective" handler="zope.browsermenu.metaconfigure.menuItemsDirective"
> >
<meta:subdirective <meta:subdirective
name="menuItem" name="menuItem"
schema="zope.app.publisher.browser.metadirectives.IMenuItemSubdirective" schema="zope.browsermenu.metadirectives.IMenuItemSubdirective"
/> />
</meta:complexDirective> </meta:complexDirective>
<meta:directive <meta:directive
name="menuItem" name="menuItem"
schema="zope.app.publisher.browser.metadirectives.IMenuItemDirective" schema="zope.browsermenu.metadirectives.IMenuItemDirective"
handler="zope.app.publisher.browser.menumeta.menuItemDirective" handler="zope.browsermenu.metaconfigure.menuItemDirective"
/> />
<meta:directive <meta:directive
name="addMenuItem" name="addMenuItem"
schema="zope.app.publisher.browser.metadirectives.IAddMenuItemDirective" schema="zope.browsermenu.metadirectives.IAddMenuItemDirective"
handler="zope.app.publisher.browser.menumeta.addMenuItem" handler="zope.browsermenu.metaconfigure.addMenuItem"
/> />
...@@ -42,46 +42,45 @@ ...@@ -42,46 +42,45 @@
<meta:complexDirective <meta:complexDirective
name="view" name="view"
schema="zope.app.publisher.browser.metadirectives.IViewDirective" schema="zope.browserpage.metadirectives.IViewDirective"
handler=".metaconfigure.view" handler=".metaconfigure.view"
> >
<meta:subdirective <meta:subdirective
name="page" name="page"
schema="zope.app.publisher.browser.metadirectives.IViewPageSubdirective" schema="zope.browserpage.metadirectives.IViewPageSubdirective"
/> />
<meta:subdirective <meta:subdirective
name="defaultPage" name="defaultPage"
schema="zope.app.publisher.browser.metadirectives.IViewDefaultPageSubdirective" schema="zope.browserpage.metadirectives.IViewDefaultPageSubdirective"
/> />
</meta:complexDirective> </meta:complexDirective>
<meta:directive <meta:directive
name="defaultView" name="defaultView"
schema="zope.app.publisher.browser.metadirectives.IDefaultViewDirective" schema="zope.publisher.zcml.IDefaultViewDirective"
handler="zope.app.publisher.browser.metaconfigure.defaultView" handler="zope.publisher.zcml.defaultView"
/> />
<!-- browser pages --> <!-- browser pages -->
<meta:directive <meta:directive
name="page" name="page"
schema="zope.app.publisher.browser.metadirectives.IPageDirective" schema="zope.browserpage.metadirectives.IPageDirective"
handler=".metaconfigure.page" handler=".metaconfigure.page"
/> />
<meta:complexDirective <meta:complexDirective
name="pages" name="pages"
schema="zope.app.publisher.browser.metadirectives.IPagesDirective" schema="zope.browserpage.metadirectives.IPagesDirective"
handler=".metaconfigure.pages" handler=".metaconfigure.pages"
> >
<meta:subdirective <meta:subdirective
name="page" name="page"
schema="zope.app.publisher.browser.metadirectives.IPagesPageSubdirective" schema="zope.browserpage.metadirectives.IPagesPageSubdirective"
/> />
</meta:complexDirective> </meta:complexDirective>
...@@ -91,13 +90,13 @@ ...@@ -91,13 +90,13 @@
<meta:directive <meta:directive
name="resource" name="resource"
schema="zope.app.publisher.browser.metadirectives.IResourceDirective" schema="zope.browserresource.metadirectives.IResourceDirective"
handler=".metaconfigure.resource" handler=".metaconfigure.resource"
/> />
<meta:directive <meta:directive
name="resourceDirectory" name="resourceDirectory"
schema="zope.app.publisher.browser.metadirectives.IResourceDirectoryDirective" schema="zope.browserresource.metadirectives.IResourceDirectoryDirective"
handler=".metaconfigure.resourceDirectory" handler=".metaconfigure.resourceDirectory"
/> />
...@@ -106,8 +105,8 @@ ...@@ -106,8 +105,8 @@
<meta:directive <meta:directive
name="defaultSkin" name="defaultSkin"
schema="zope.app.publisher.browser.metadirectives.IDefaultSkinDirective" schema="zope.publisher.zcml.IDefaultSkinDirective"
handler="zope.app.publisher.browser.metaconfigure.defaultSkin" handler="zope.publisher.zcml.defaultSkin"
/> />
</meta:directives> </meta:directives>
......
...@@ -32,10 +32,10 @@ from zope.publisher.interfaces.browser import IDefaultBrowserLayer ...@@ -32,10 +32,10 @@ from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.publisher.interfaces.browser import IBrowserPublisher from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.interfaces.browser import IBrowserRequest from zope.publisher.interfaces.browser import IBrowserRequest
import zope.app.publisher.browser.viewmeta import zope.browserpage.metaconfigure
from zope.app.publisher.browser.viewmeta import providesCallable from zope.browserpage.metaconfigure import providesCallable
from zope.app.publisher.browser.viewmeta import _handle_menu from zope.browserpage.metaconfigure import _handle_menu
from zope.app.publisher.browser.viewmeta import _handle_for from zope.browserpage.metaconfigure import _handle_for
from AccessControl.security import getSecurityInfo from AccessControl.security import getSecurityInfo
from AccessControl.security import protectClass from AccessControl.security import protectClass
...@@ -165,7 +165,7 @@ def page(_context, name, permission, for_, ...@@ -165,7 +165,7 @@ def page(_context, name, permission, for_,
args = (new_class,) args = (new_class,)
) )
class pages(zope.app.publisher.browser.viewmeta.pages): class pages(zope.browserpage.metaconfigure.pages):
def page(self, _context, name, attribute='__call__', template=None, def page(self, _context, name, attribute='__call__', template=None,
menu=None, title=None): menu=None, title=None):
...@@ -178,7 +178,7 @@ class pages(zope.app.publisher.browser.viewmeta.pages): ...@@ -178,7 +178,7 @@ class pages(zope.app.publisher.browser.viewmeta.pages):
# view (named view with pages) # view (named view with pages)
class view(zope.app.publisher.browser.viewmeta.view): class view(zope.browserpage.metaconfigure.view):
def __call__(self): def __call__(self):
(_context, name, for_, permission, layer, class_, (_context, name, for_, permission, layer, class_,
...@@ -396,7 +396,7 @@ def resourceDirectory(_context, name, directory, layer=IDefaultBrowserLayer, ...@@ -396,7 +396,7 @@ def resourceDirectory(_context, name, directory, layer=IDefaultBrowserLayer,
) )
class ViewMixinForAttributes(BrowserView, class ViewMixinForAttributes(BrowserView,
zope.app.publisher.browser.viewmeta.simple): zope.browserpage.metaconfigure.simple):
# For some reason, the 'simple' baseclass doesn't implement this # For some reason, the 'simple' baseclass doesn't implement this
# mandatory method (see https://bugs.launchpad.net/zope3/+bug/129296) # mandatory method (see https://bugs.launchpad.net/zope3/+bug/129296)
......
...@@ -18,14 +18,14 @@ $Id$ ...@@ -18,14 +18,14 @@ $Id$
import os import os
import urllib import urllib
import zope.browserresource.directory
import zope.browserresource.file
from zope.browserresource.file import File
from zope.interface import implements from zope.interface import implements
from zope.component import getMultiAdapter
from zope.traversing.browser import absoluteURL from zope.traversing.browser import absoluteURL
from zope.publisher.interfaces import NotFound from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.browser import IBrowserPublisher from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.browser import fileresource, directoryresource from zope.ptresource.ptresource import PageTemplate
from zope.app.publisher.fileresource import File, Image
from zope.app.publisher.pagetemplateresource import PageTemplate
from Products.Five.browser import BrowserView from Products.Five.browser import BrowserView
...@@ -70,7 +70,7 @@ class PageTemplateResource(Resource, BrowserView): ...@@ -70,7 +70,7 @@ class PageTemplateResource(Resource, BrowserView):
pt = self.context pt = self.context
return pt(self.request) return pt(self.request)
class FileResource(Resource, fileresource.FileResource): class FileResource(Resource, zope.browserresource.file.FileResource):
pass pass
class ResourceFactory: class ResourceFactory:
...@@ -111,7 +111,7 @@ class FileResourceFactory(ResourceFactory): ...@@ -111,7 +111,7 @@ class FileResourceFactory(ResourceFactory):
class ImageResourceFactory(ResourceFactory): class ImageResourceFactory(ResourceFactory):
"""A factory for Image resources""" """A factory for Image resources"""
factory = Image factory = File
resource = FileResource resource = FileResource
...@@ -122,7 +122,8 @@ class Directory: ...@@ -122,7 +122,8 @@ class Directory:
self.path = path self.path = path
self.__name__ = name self.__name__ = name
class DirectoryResource(Resource, directoryresource.DirectoryResource): class DirectoryResource(Resource,
zope.browserresource.directory.DirectoryResource):
resource_factories = { resource_factories = {
'gif': ImageResourceFactory, 'gif': ImageResourceFactory,
......
...@@ -36,7 +36,7 @@ def test_menu(): ...@@ -36,7 +36,7 @@ def test_menu():
Now for some actual testing... Let's look up the menu we registered: Now for some actual testing... Let's look up the menu we registered:
>>> from zope.publisher.browser import TestRequest >>> from zope.publisher.browser import TestRequest
>>> from zope.app.publisher.browser.menu import getMenu >>> from zope.browsermenu.menu import getMenu
>>> request = TestRequest() >>> request = TestRequest()
>>> menu = getMenu('testmenu', self.folder, request) >>> menu = getMenu('testmenu', self.folder, request)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
$Id$ $Id$
""" """
from zope.interface import Interface from zope.interface import Interface
from zope.app.publisher.browser.metadirectives import IBasicResourceInformation from zope.browserresource.metadirectives import IBasicResourceInformation
from zope.security.zcml import Permission from zope.security.zcml import Permission
from zope.configuration.fields import GlobalObject, Tokens, PythonIdentifier from zope.configuration.fields import GlobalObject, Tokens, PythonIdentifier
from zope.configuration.fields import Bool from zope.configuration.fields import Bool
......
...@@ -23,7 +23,7 @@ from zope.interface import Interface ...@@ -23,7 +23,7 @@ from zope.interface import Interface
from zope.i18nmessageid import MessageFactory from zope.i18nmessageid import MessageFactory
_ = MessageFactory('zope') _ = MessageFactory('zope')
from zope.app.publisher.browser.menumeta import menuItemDirective from zope.browsermenu.metaconfigure import menuItemDirective
from zope.app.form.browser.metaconfigure import BaseFormDirective from zope.app.form.browser.metaconfigure import BaseFormDirective
from zope.browser.interfaces import IAdding from zope.browser.interfaces import IAdding
from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.publisher.interfaces.browser import IDefaultBrowserLayer
......
...@@ -17,7 +17,7 @@ $Id$ ...@@ -17,7 +17,7 @@ $Id$
""" """
import os import os
from zope.app.publisher.browser import viewmeta from zope.browserpage.metaconfigure import _handle_for
from zope.component import zcml from zope.component import zcml
from zope.configuration.exceptions import ConfigurationError from zope.configuration.exceptions import ConfigurationError
from zope.interface import Interface from zope.interface import Interface
...@@ -65,7 +65,7 @@ def viewletManagerDirective( ...@@ -65,7 +65,7 @@ def viewletManagerDirective(
new_class = manager.ViewletManager(name, provides, bases=(class_, )) new_class = manager.ViewletManager(name, provides, bases=(class_, ))
# Register interfaces # Register interfaces
viewmeta._handle_for(_context, for_) _handle_for(_context, for_)
zcml.interface(_context, view) zcml.interface(_context, view)
# register a viewlet manager # register a viewlet manager
...@@ -161,7 +161,7 @@ def viewletDirective( ...@@ -161,7 +161,7 @@ def viewletDirective(
attributes=kwargs) attributes=kwargs)
# Register the interfaces. # Register the interfaces.
viewmeta._handle_for(_context, for_) _handle_for(_context, for_)
zcml.interface(_context, view) zcml.interface(_context, view)
# register viewlet # register viewlet
......
...@@ -52,7 +52,7 @@ zope.app.localpermission = 3.7.0 ...@@ -52,7 +52,7 @@ zope.app.localpermission = 3.7.0
zope.app.pagetemplate = 3.7.1 zope.app.pagetemplate = 3.7.1
zope.app.principalannotation = 3.6.1 zope.app.principalannotation = 3.6.1
zope.app.publication = 3.8.1 zope.app.publication = 3.8.1
zope.app.publisher = 3.8.4 zope.app.publisher = 3.9.0
zope.app.renderer = 3.5.1 zope.app.renderer = 3.5.1
zope.app.rotterdam = 3.5.0 zope.app.rotterdam = 3.5.0
zope.app.schema = 3.5.0 zope.app.schema = 3.5.0
...@@ -74,7 +74,7 @@ zope.catalog = 3.8.0 ...@@ -74,7 +74,7 @@ zope.catalog = 3.8.0
zope.component = 3.7.1 zope.component = 3.7.1
zope.componentvocabulary = 1.0 zope.componentvocabulary = 1.0
zope.configuration = 3.6.0 zope.configuration = 3.6.0
zope.container = 3.8.2 zope.container = 3.9.0
zope.contentprovider = 3.5.0 zope.contentprovider = 3.5.0
zope.contenttype = 3.4.2 zope.contenttype = 3.4.2
zope.copy = 3.5.0 zope.copy = 3.5.0
...@@ -109,7 +109,7 @@ zope.principalregistry = 3.7.0 ...@@ -109,7 +109,7 @@ zope.principalregistry = 3.7.0
zope.processlifetime = 1.0 zope.processlifetime = 1.0
zope.proxy = 3.5.0 zope.proxy = 3.5.0
zope.ptresource = 3.9.0 zope.ptresource = 3.9.0
zope.publisher = 3.8.0 zope.publisher = 3.9.0
zope.schema = 3.5.4 zope.schema = 3.5.4
zope.security = 3.7.1 zope.security = 3.7.1
zope.securitypolicy = 3.6.1 zope.securitypolicy = 3.6.1
...@@ -125,5 +125,5 @@ zope.tales = 3.4.0 ...@@ -125,5 +125,5 @@ zope.tales = 3.4.0
zope.testbrowser = 3.6.0a2 zope.testbrowser = 3.6.0a2
zope.testing = 3.8.1 zope.testing = 3.8.1
zope.thread = 3.4 zope.thread = 3.4
zope.traversing = 3.7.1 zope.traversing = 3.7.2
zope.viewlet = 3.6.1 zope.viewlet = 3.6.1
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