[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - globalbrowsermenuservice.py:1.14 i18nresourcemeta.py:1.7 viewmeta.py:1.21
Jim Fulton
jim@zope.com
Fri, 18 Apr 2003 18:12:58 -0400
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv8556/src/zope/app/publisher/browser
Modified Files:
globalbrowsermenuservice.py i18nresourcemeta.py viewmeta.py
Log Message:
In prepration for the upcoming interface changes, I added some
new functions for making interface assertions on instances.
Rather than:
class C:
__class_implements__ = I1, I2
use:
class C:
classProvides(I1, I2)
rather than:
__implements__ = I1, I2
use:
moduleProvides(I1, I2)
rather than:
someinstance.__implements__ = I1, I2
use:
directlyProvides(I1, I2)
Note that interface assertions on persistent objects should be aboided
since the internal representation will change.
Continue to make assertions about the interfaces that class instances
implement the same way:
class C:
__implements__ = I1, I2
I also modified the core software to use the new spellings.
=== Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py:1.13 Fri Apr 11 18:15:47 2003
+++ Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py Fri Apr 18 18:12:27 2003
@@ -12,6 +12,7 @@
#
##############################################################################
+from zope.interface import classProvides
from zope.exceptions import DuplicationError, Unauthorized, Forbidden
from zope.configuration.action import Action
@@ -176,7 +177,7 @@
class menuItemsDirective:
- __class_implements__ = INonEmptyDirective
+ classProvides(INonEmptyDirective)
__implements__ = ISubdirectiveHandler
def __init__(self, _context, menu, for_):
=== Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py:1.6 Tue Feb 11 21:17:27 2003
+++ Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py Fri Apr 18 18:12:27 2003
@@ -16,6 +16,7 @@
$Id$
"""
+from zope.interface import classProvides
from zope.security.proxy import Proxy
from zope.security.checker \
import CheckerPublic, NamesChecker, Checker
@@ -37,7 +38,7 @@
class I18nResource(object):
- __class_implements__ = INonEmptyDirective
+ classProvides(INonEmptyDirective)
__implements__ = ISubdirectiveHandler
type = IBrowserPresentation
=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.20 Fri Apr 11 18:15:47 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py Fri Apr 18 18:12:27 2003
@@ -16,6 +16,7 @@
$Id$
"""
+from zope.interface import classProvides, directlyProvides
import os
from zope.interface.implements import implements
@@ -214,7 +215,7 @@
class pages:
- __class_implements__ = INonEmptyDirective
+ classProvides(INonEmptyDirective)
__implements__ = ISubdirectiveHandler
def __init__(self, _context, for_, permission,
@@ -247,7 +248,7 @@
class view:
- __class_implements__ = INonEmptyDirective
+ classProvides(INonEmptyDirective)
__implements__ = ISubdirectiveHandler
default = None
@@ -404,7 +405,7 @@
menu, title, usage
)
-addview.__implements__ = INonEmptyDirective
+directlyProvides(addview, INonEmptyDirective)
def defaultView(_context, name, for_=None):