[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - utility.py:1.1.2.2
Guido van Rossum
guido@python.org
Thu, 13 Mar 2003 17:28:40 -0500
Update of /cvs-repository/Zope3/src/zope/app/interfaces/services
In directory cvs.zope.org:/tmp/cvs-serv3523/src/zope/app/interfaces/services
Modified Files:
Tag: local-utility-branch
utility.py
Log Message:
Checkpoint checkin (Jim+Guido).
=== Zope3/src/zope/app/interfaces/services/utility.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/interfaces/services/utility.py:1.1.2.1 Thu Mar 13 15:05:44 2003
+++ Zope3/src/zope/app/interfaces/services/utility.py Thu Mar 13 17:28:09 2003
@@ -1,29 +1,35 @@
##############################################################################
+#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
+#
##############################################################################
-"""XXX short summary goes here.
-
-XXX longer description goes here.
+"""Interfaces pertaining to local utilities.
$Id$
"""
-__metaclass__ = type
from zope.app.interfaces.services.configuration \
import INamedComponentConfiguration
from zope.app.component.interfacefield import InterfaceField
from zope.app.security.permission import PermissionField
from zope.schema import BytesLine, TextLine
+from zope.app.interfaces.services.configuration import IUseConfigurable
class IUtilityConfiguration(INamedComponentConfiguration):
+ """Utility configuration object.
+
+ This inherits fields 'name', 'componentPath', 'permission', and
+ adds a field 'interface'. It also inherits a method
+ getComponent().
+ """
interface = InterfaceField(
title = u"Provided interface",
@@ -31,3 +37,15 @@
readonly = True,
required = True,
)
+
+class ILocalUtility(IUseConfigurable):
+ """Local utility marker.
+
+ A marker interface that indicates that a component can be used as
+ a local utility.
+
+ Utilities should usually also declare they implement
+ IAttributeAnnotatable, so that the standard adapter to
+ IUseConfiguration can be used; otherwise, they must provide
+ another way to be adaptable to IUseConfiguration.
+ """