[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - fileresource.py:1.6 globalbrowsermenuservice.py:1.15 i18nfileresource.py:1.5 i18nresourcemeta.py:1.9 resources.py:1.9 viewmeta.py:1.26
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 01:46:33 -0400
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv29577/src/zope/app/publisher/browser
Modified Files:
fileresource.py globalbrowsermenuservice.py
i18nfileresource.py i18nresourcemeta.py resources.py
viewmeta.py
Log Message:
more new-style implements declarations
=== Zope3/src/zope/app/publisher/browser/fileresource.py 1.5 => 1.6 ===
--- 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 Sat Jun 7 01:46:02 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.15 ===
--- 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 Sat Jun 7 01:46:02 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 = {}
@@ -178,7 +179,7 @@
class menuItemsDirective:
classProvides(INonEmptyDirective)
- __implements__ = ISubdirectiveHandler
+ implements(ISubdirectiveHandler)
def __init__(self, _context, menu, for_):
if for_ == '*':
@@ -189,7 +190,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.5 ===
--- 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 Sat Jun 7 01:46:02 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.9 ===
--- 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 Sat Jun 7 01:46:02 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/resources.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/publisher/browser/resources.py:1.8 Sun Jun 1 11:59:35 2003
+++ Zope3/src/zope/app/publisher/browser/resources.py Sat Jun 7 01:46:02 2003
@@ -24,12 +24,13 @@
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.25 => 1.26 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.25 Tue May 27 10:18:22 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py Sat Jun 7 01:46:02 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
@@ -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)