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