[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - configure.zcml:1.4.24.1 fileresource.py:1.5.22.1 globalbrowsermenuservice.py:1.14.12.1 i18nfileresource.py:1.4.10.1 i18nresourcemeta.py:1.8.10.1 metaconfigure.py:1.7.10.1 resource.py:1.3.14.1 resources.py:1.6.22.1 viewmeta.py:1.24.2.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:20 -0400
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/publisher/browser
Modified Files:
Tag: cw-mail-branch
configure.zcml fileresource.py globalbrowsermenuservice.py
i18nfileresource.py i18nresourcemeta.py metaconfigure.py
resource.py resources.py viewmeta.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/publisher/browser/configure.zcml 1.4 => 1.4.24.1 ===
--- Zope3/src/zope/app/publisher/browser/configure.zcml:1.4 Sat Jan 25 08:22:19 2003
+++ Zope3/src/zope/app/publisher/browser/configure.zcml Sun Jun 22 10:23:19 2003
@@ -25,6 +25,15 @@
interface="zope.component.interfaces.IPresentationRequest" />
</content>
+<content class="zope.publisher.browser.TestRequest">
+ <allow
+ interface="zope.publisher.interfaces.browser.IBrowserApplicationRequest"
+ attributes="response"
+ />
+ <allow
+ interface="zope.component.interfaces.IPresentationRequest" />
+</content>
+
<content class="zope.publisher.browser.BrowserResponse">
<allow
interface="zope.publisher.interfaces.http.IHTTPResponse"
=== Zope3/src/zope/app/publisher/browser/fileresource.py 1.5 => 1.5.22.1 ===
--- Zope3/src/zope/app/publisher/browser/fileresource.py:1.5 Tue Feb 11 10:59:53 2003
+++ Zope3/src/zope/app/publisher/browser/fileresource.py Sun Jun 22 10:23:19 2003
@@ -29,9 +29,11 @@
from zope.security.proxy import Proxy
+from zope.interface import implements
+
class FileResource(BrowserView, Resource):
- __implements__ = IBrowserResource, IBrowserPublisher
+ implements(IBrowserResource, IBrowserPublisher)
def publishTraverse(self, request, name):
'''See interface IBrowserPublisher'''
=== Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py 1.14 => 1.14.12.1 ===
--- Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py:1.14 Fri Apr 18 18:12:27 2003
+++ Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py Sun Jun 22 10:23:19 2003
@@ -18,6 +18,7 @@
from zope.configuration.action import Action
from zope.interface.type import TypeRegistry
+from zope.interface import implements
from zope.configuration.interfaces import INonEmptyDirective
from zope.configuration.interfaces import ISubdirectiveHandler
@@ -37,19 +38,19 @@
class Menu(object):
'''Browser menu
'''
-
+
def __init__(self, title, description=u'', usage=u''):
self.title = title
self.description = description
self.usage = usage
self.registry = TypeRegistry()
-
+
class GlobalBrowserMenuService(object):
"""Global Browser Menu Service
"""
- __implements__ = IBrowserMenuService
+ implements(IBrowserMenuService)
def __init__(self):
self._registry = {}
@@ -123,9 +124,13 @@
elif action:
# Otherwise, test access by attempting access
+ path = action
+ l = action.find('?')
+ if l >= 0:
+ path = action[:l]
try:
v = traverser.traverseRelativeURL(
- request, object, action)
+ request, object, path)
# XXX
# tickle the security proxy's checker
# we're assuming that view pages are callable
@@ -178,7 +183,7 @@
class menuItemsDirective:
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
def __init__(self, _context, menu, for_):
if for_ == '*':
@@ -189,7 +194,7 @@
def menuItem(self, _context, action, title, description='',
filter=None, permission=None):
-
+
return [
Action(
discriminator = ('browser:menuItem',
=== Zope3/src/zope/app/publisher/browser/i18nfileresource.py 1.4 => 1.4.10.1 ===
--- Zope3/src/zope/app/publisher/browser/i18nfileresource.py:1.4 Thu May 1 15:35:27 2003
+++ Zope3/src/zope/app/publisher/browser/i18nfileresource.py Sun Jun 22 10:23:19 2003
@@ -25,11 +25,12 @@
from zope.i18n.negotiator import negotiator
from zope.i18n.interfaces import II18nAware
+from zope.interface import implements
class I18nFileResource(FileResource):
- __implements__ = IBrowserResource, IBrowserPublisher, II18nAware
+ implements(IBrowserResource, IBrowserPublisher, II18nAware)
def __init__(self, data, request, defaultLanguage='en'):
"""Creates an internationalized file resource. data should be
=== Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py 1.8 => 1.8.10.1 ===
--- Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py:1.8 Thu May 1 15:35:27 2003
+++ Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py Sun Jun 22 10:23:19 2003
@@ -16,7 +16,7 @@
$Id$
"""
-from zope.interface import classProvides
+from zope.interface import classProvides, implements
from zope.security.proxy import Proxy
from zope.security.checker import CheckerPublic, Checker
@@ -32,13 +32,12 @@
from zope.app.component.metaconfigure import handler
from zope.app.publisher.fileresource import File, Image
-from zope.app.publisher.browser.i18nfileresource \
- import I18nFileResourceFactory
+from zope.app.publisher.browser.i18nfileresource import I18nFileResourceFactory
class I18nResource(object):
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
type = IBrowserPresentation
default_allowed_attributes = '__call__'
=== Zope3/src/zope/app/publisher/browser/metaconfigure.py 1.7 => 1.7.10.1 ===
--- Zope3/src/zope/app/publisher/browser/metaconfigure.py:1.7 Thu May 1 15:35:27 2003
+++ Zope3/src/zope/app/publisher/browser/metaconfigure.py Sun Jun 22 10:23:19 2003
@@ -21,9 +21,8 @@
from zope.publisher.interfaces.browser import IBrowserPresentation
from zope.app.services.servicenames import Interfaces
-from zope.app.component.metaconfigure \
- import defaultView as _defaultView, skin as _skin, \
- handler, resolveInterface
+from zope.app.component.metaconfigure import skin as _skin
+from zope.app.component.metaconfigure import handler, resolveInterface
# referred to through ZCML
from zope.app.publisher.browser.resourcemeta import resource
=== Zope3/src/zope/app/publisher/browser/resource.py 1.3 => 1.3.14.1 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.3 Tue Apr 15 08:24:33 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py Sun Jun 22 10:23:19 2003
@@ -18,8 +18,8 @@
__metaclass__ = type # All classes are new style when run with Python 2.2+
from zope.component import queryView
-from zope.proxy.context import getWrapperContainer, getInnerWrapperData
-from zope.proxy.context import ContextMethod
+from zope.context import getWrapperContainer, getInnerWrapperData
+from zope.context import ContextMethod
from zope.app.traversing import joinPath
class Resource:
=== Zope3/src/zope/app/publisher/browser/resources.py 1.6 => 1.6.22.1 ===
--- Zope3/src/zope/app/publisher/browser/resources.py:1.6 Tue Feb 11 21:17:27 2003
+++ Zope3/src/zope/app/publisher/browser/resources.py Sun Jun 22 10:23:19 2003
@@ -21,15 +21,16 @@
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.component import getService
from zope.app.services.servicenames import Resources as ResourceService
-from zope.proxy.context import ContextWrapper
-from zope.proxy.context import ContextMethod
+from zope.app.context import ContextWrapper
+from zope.context import ContextMethod
from zope.exceptions import NotFoundError
+from zope.interface import implements
class Resources(BrowserView):
"""Provide a URL-accessible resource namespace
"""
- __implements__ = BrowserView.__implements__, IBrowserPublisher
+ implements(IBrowserPublisher)
def publishTraverse(wrapped_self, request, name):
'''See interface IBrowserPublisher'''
=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.24 => 1.24.2.1 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.24 Wed May 14 09:33:02 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py Sun Jun 22 10:23:19 2003
@@ -19,7 +19,7 @@
from zope.interface import classProvides, directlyProvides
import os
-from zope.interface.implements import implements
+from zope.interface import implements, classImplements
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.exceptions import NotFoundError
@@ -46,7 +46,7 @@
from zope.app.security.permission import checkPermission
-from zope.proxy.context import ContextMethod
+from zope.context import ContextMethod
from zope.app.publisher.browser.globalbrowsermenuservice \
import menuItemDirective, globalBrowserMenuService
@@ -161,11 +161,11 @@
new_class = type(original_class.__name__,
(original_class, simple,),
cdict)
- new_class.usage = usage
+ new_class.usage = usage
if hasattr(original_class, '__implements__'):
- implements(new_class, IBrowserPublisher)
- implements(new_class, IBrowserPresentation, check=False)
+ classImplements(new_class, IBrowserPublisher)
+ classImplements(new_class, IBrowserPresentation)
else:
# template
@@ -213,7 +213,7 @@
class pages:
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
def __init__(self, _context, for_, permission,
layer='default', class_=None,
@@ -246,7 +246,7 @@
class view:
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
default = None
@@ -493,7 +493,7 @@
return for_
class simple(BrowserView):
- __implements__ = IBrowserPublisher, BrowserView.__implements__
+ implements(IBrowserPublisher)
def publishTraverse(self, request, name):
raise NotFoundError(self, name, request)