[Checkins] SVN: zope.generic/trunk/src/zope/generic/ clean up the unused configuration handlers

Dominik Huber dominik.huber at perse.ch
Thu Apr 13 05:45:58 EDT 2006


Log message for revision 66927:
  clean up the unused configuration handlers

Changed:
  U   zope.generic/trunk/src/zope/generic/component/api.py
  U   zope.generic/trunk/src/zope/generic/component/base.py
  U   zope.generic/trunk/src/zope/generic/component/helper.py
  U   zope.generic/trunk/src/zope/generic/component/interfaces.py
  U   zope.generic/trunk/src/zope/generic/configuration/README.txt
  U   zope.generic/trunk/src/zope/generic/configuration/adapter.py
  U   zope.generic/trunk/src/zope/generic/configuration/api.py
  U   zope.generic/trunk/src/zope/generic/configuration/base.py
  U   zope.generic/trunk/src/zope/generic/configuration/event.py
  U   zope.generic/trunk/src/zope/generic/configuration/helper.py
  U   zope.generic/trunk/src/zope/generic/configuration/interfaces.py
  U   zope.generic/trunk/src/zope/generic/configuration/meta.zcml
  U   zope.generic/trunk/src/zope/generic/configuration/metaconfigure.py
  U   zope.generic/trunk/src/zope/generic/configuration/metadirectives.py
  U   zope.generic/trunk/src/zope/generic/information/NEW_README.txt
  U   zope.generic/trunk/src/zope/generic/information/base.py
  U   zope.generic/trunk/src/zope/generic/information/helper.py
  U   zope.generic/trunk/src/zope/generic/information/interfaces.py
  U   zope.generic/trunk/src/zope/generic/operation/interfaces.py
  U   zope.generic/trunk/src/zope/generic/type/interfaces.py

-=-
Modified: zope.generic/trunk/src/zope/generic/component/api.py
===================================================================
--- zope.generic/trunk/src/zope/generic/component/api.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/component/api.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -18,7 +18,7 @@
 
 __docformat__ = 'restructuredtext'
 
-from zope.generic.component.base import InterfaceKeyDescription
+from zope.generic.component.base import KeyInterfaceDescription
 from zope.generic.component.helper import getKey
 from zope.generic.component.helper import queryKey
 from zope.generic.component.helper import toComponent

Modified: zope.generic/trunk/src/zope/generic/component/base.py
===================================================================
--- zope.generic/trunk/src/zope/generic/component/base.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/component/base.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -21,14 +21,14 @@
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.interface import implements
 
-from zope.generic.component import IInterfaceKeyDescription
+from zope.generic.component import IKeyInterfaceDescription
 
 
 
-class InterfaceKeyDescription(object):
+class KeyInterfaceDescription(object):
     """Information description."""
 
-    implements(IInterfaceKeyDescription)
+    implements(IKeyInterfaceDescription)
 
     def __init__(self, interface, label=None, hint=None):
         self.interface = interface

Modified: zope.generic/trunk/src/zope/generic/component/helper.py
===================================================================
--- zope.generic/trunk/src/zope/generic/component/helper.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/component/helper.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -21,7 +21,7 @@
 from zope.dottedname.resolve import resolve
 from zope.interface.interfaces import IInterface
 
-from zope.generic.component import IInterfaceKey
+from zope.generic.component import IKeyInterface
 
 
 
@@ -48,11 +48,11 @@
     if IInterface.providedBy(component):
         interface = component
 
-    elif IInterfaceKey.providedBy(component):
+    elif IKeyInterface.providedBy(component):
         interface = component.interface
 
     else:
-        interface = IInterfaceKey(component).interface
+        interface = IKeyInterface(component).interface
 
     return interface
 

Modified: zope.generic/trunk/src/zope/generic/component/interfaces.py
===================================================================
--- zope.generic/trunk/src/zope/generic/component/interfaces.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/component/interfaces.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -27,9 +27,27 @@
 
 
 
-class IInterfaceKey(Interface):
-    """Declare an interface as information-specific-key."""
+class IKeyInterfaceProvider(Interface):
+    """Assert that a key interface can be looked up.
 
+    The key interface must be provided by adaption to IKeyInterface."""
+
+
+
+class IKeyInterfaceAttributeProvider(IKeyInterfaceProvider):
+    """Provide the key interface within an attribute.
+
+    The key interface is stored within the __key_interface__ attribute.
+    """
+
+
+
+class IKeyInterface(IKeyInterfaceProvider):
+    """Declare a key interface as component-specific key.
+
+    You can use this key to lookup component-specific informations.
+    """
+
     interface = Object(
         title=_('Interface'),
         description=_('Interface marker that can be used as' +
@@ -40,7 +58,7 @@
 
 
 
-class IInterfaceKeyDescription(IInterfaceKey):
+class IKeyInterfaceDescription(IKeyInterface):
     """Describe the associated interface key."""
 
     label = TextLine(title=_('Label'),

Modified: zope.generic/trunk/src/zope/generic/configuration/README.txt
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/README.txt	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/README.txt	2006-04-13 09:45:57 UTC (rev 66927)
@@ -49,7 +49,7 @@
 not satify the condition:
 
     >>> from zope.app.event.tests.placelesssetup import getEvents, clearEvents
-    >>> from zope.generic.configuration import IObjectConfigurationsModifiedEvent
+    >>> from zope.generic.configuration import IObjectConfiguredEvent
     >>> events = getEvents()
     >>> len(events)
     0 
@@ -177,7 +177,7 @@
     1
 
     >>> event = events.pop()
-    >>> IObjectConfigurationsModifiedEvent.providedBy(event)
+    >>> IObjectConfiguredEvent.providedBy(event)
     True
     >>> [(key.__name__, value) for key, value in event.items()]
     [('IFooConfiguration', {'foo': u'Foo!', 'optional': u'Bla'})]
@@ -224,33 +224,3 @@
     >>> event = events.pop()
     >>> [(key.__name__, value) for key, value in event.items()]
     [('IFooConfiguration', {})]
-
-
-Configuration Handler
----------------------
-
-The configurationHandler directive allows to share public configuration handlers.
-Those handlers have to provide a dedicated marker interface. This interface
-can be used for later lookup of such an handler:
-
-	>>> class IMyConfigurationHandler(interface.Interface):
-	...		pass
-
-	>>> def myConfigurationHandler(event, component, configurations=None, annotations=None):
-	...		print event, component, configurations, annotations
-
-    >>> registerDirective('''
-    ... <generic:configurationHandler
-    ...     interface='example.IMyConfigurationHandler'
-    ...     label='My Configuration Handler' hint='Please use it'
-    ...		handler='example.myConfigurationHandler'
-    ...     />
-    ... ''')
-
-After the registration we can retrieve this handler by the following function:
-
-	>>> from zope.generic.configuration.api import queryConfigurationHandler
-
-	>>> handler = queryConfigurationHandler(IMyConfigurationHandler)
-	>>> handler('component', 'event', 'configurations', 'annotations')
-	component event configurations annotations

Modified: zope.generic/trunk/src/zope/generic/configuration/adapter.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/adapter.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/adapter.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -35,7 +35,7 @@
 from zope.generic.configuration import IConfigurationType
 from zope.generic.configuration import IConfigurations
 from zope.generic.configuration.event import Configuration
-from zope.generic.configuration.event import ObjectConfigurationsModifiedEvent
+from zope.generic.configuration.event import ObjectConfiguredEvent
 from zope.generic.configuration.helper import configuratonToDict
 
 
@@ -99,7 +99,7 @@
             # notify update
             parent = self.__parent__
             if updated_data and ILocation.providedBy(parent) and parent.__parent__ is not None:
-                notify(ObjectConfigurationsModifiedEvent(parent, 
+                notify(ObjectConfiguredEvent(parent, 
                     Configuration(interface, updated_data)))
 
         except:
@@ -126,7 +126,7 @@
         # notify setting
         parent = self.__parent__
         if ILocation.providedBy(parent) and parent.__parent__ is not None:
-            notify(ObjectConfigurationsModifiedEvent(parent, 
+            notify(ObjectConfiguredEvent(parent, 
                 Configuration(interface, data)))
 
     def __delitem__(self, interface):
@@ -140,5 +140,5 @@
         # notify setting
         parent = self.__parent__
         if ILocation.providedBy(parent) and parent.__parent__ is not None:
-            notify(ObjectConfigurationsModifiedEvent(parent, 
+            notify(ObjectConfiguredEvent(parent, 
                 Configuration(interface, {})))

Modified: zope.generic/trunk/src/zope/generic/configuration/api.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/api.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/api.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -23,5 +23,4 @@
 from zope.generic.configuration.helper import getConfigurationData
 from zope.generic.configuration.helper import provideConfigurationData
 from zope.generic.configuration.helper import queryConfigurationData
-from zope.generic.configuration.helper import queryConfigurationHandler
 from zope.generic.configuration.helper import queryConfigurationInformation

Modified: zope.generic/trunk/src/zope/generic/configuration/base.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/base.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/base.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -21,18 +21,13 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
-from zope.app.annotation import IAnnotations
 from zope.interface import directlyProvides
 from zope.interface import implements
 from zope.interface.interfaces import IMethod
 from zope.schema.interfaces import IField
-from zope.schema.fieldproperty import FieldProperty
 
-from zope.generic.configuration import IConfigurationHandler
 from zope.generic.configuration import IConfigurations
-from zope.generic.configuration import missing
 
-__all__ = ['ConfigurationData']
 _marker = object()
 
 
@@ -148,58 +143,3 @@
             data[name] = value
         else:
             super(ConfigurationData, self).__setattr__(name, value)
-
-
-
-class ConfigurationHandler(object):
-    """Configuration handler."""
-
-    implements(IConfigurationHandler)
-
-    interface = FieldProperty(IConfigurationHandler['interface'])
-    passConfigurations = FieldProperty(IConfigurationHandler['passConfigurations'])
-    passAnnotations = FieldProperty(IConfigurationHandler['passAnnotations'])
-
-    def __init__(self, callable, interface=None, passConfigurations=False,
-                 passAnnotations=False):
-
-        self.__callable = callable
-
-        # otherwise use IPrivatConfigurationHandler
-        if interface is not None:
-            self.interface = interface
-
-        self.passAnnotations = passAnnotations
-        self.passConfigurations = passConfigurations
-
-    def __call__(self, component, event, configurations=None, annotations=None):
-        if configurations is None and self.passConfigurations is True:
-            configurations = IConfigurations(component, missing)
-
-        if annotations is None and self.passAnnotations is True:
-            annotations = IAnnotations(component, missing)
-
-        self._apply(component, event, configurations, annotations)
-
-    def _apply(self, component, event, configurations, annotations):
-        # this method can be overwritten by subclasses
-        if self.__callable is not None:
-            return self.__callable(component, event, configurations, annotations)
-
-
-
-class ConfigurationHandlerChain(ConfigurationHandler):
-    """Process a chain of configuration handlers."""
-
-    implements(IConfigurationHandler)
-
-    interface = FieldProperty(IConfigurationHandler['interface'])
-
-    def __init__(self, handlers, interface=None, passConfigurations=True,
-                 passAnnotations=True):
-        super(ConfigurationHandlerChain, self).__intit__(None, interface, passConfigurations, passAnnotations)
-        self.__handlers = handlers
-
-    def _apply(self, component, event, configurations, annotations):
-        """Invoke handler in the listed order."""
-        [handler(component, event, configurations, annotations) for handler in self.__handlers]

Modified: zope.generic/trunk/src/zope/generic/configuration/event.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/event.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/event.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -18,10 +18,10 @@
 
 __docformat__ = 'restructuredtext'
 
-from zope.app.event.objectevent import ObjectModifiedEvent
+from zope.app.event.objectevent import ObjectEvent
 from zope.interface import implements
 
-from zope.generic.configuration import IObjectConfigurationsModifiedEvent
+from zope.generic.configuration import IObjectConfiguredEvent
 from zope.generic.configuration import IConfigurationModificationDescription
 
 
@@ -76,7 +76,7 @@
 
 
 
-class ObjectConfigurationsModifiedEvent(ObjectModifiedEvent):
+class ObjectConfiguredEvent(ObjectEvent):
     """An object's configurations has been modified.
         
     A possible configuration schema:
@@ -101,7 +101,7 @@
         >>> from zope.app.event.objectevent import Attributes
         >>> descriptions.append(Attributes(IRegularInterface))
         >>> context = object()
-        >>> event = ObjectConfigurationsModifiedEvent(context, *descriptions)
+        >>> event = ObjectConfiguredEvent(context, *descriptions)
 
     There are two convenience function to introspect configuration modifications
     specifically:
@@ -125,8 +125,12 @@
         'default'
     """
 
-    implements(IObjectConfigurationsModifiedEvent)
+    implements(IObjectConfiguredEvent)
 
+    def __init__(self, object, *descriptions):
+        super(ObjectConfiguredEvent, self).__init__(object) 
+        self.descriptions = descriptions
+
     def items(self):
         return [(d.interface, d.data) for d in self.descriptions 
                    if IConfigurationModificationDescription.providedBy(d)]

Modified: zope.generic/trunk/src/zope/generic/configuration/helper.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/helper.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/helper.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -23,8 +23,6 @@
 
 from zope.generic.component.api import toDottedName
 
-from zope.generic.configuration import IConfigurationHandlerConfiguration
-from zope.generic.configuration import IConfigurationHandlerInformation
 from zope.generic.configuration import IConfigurationInformation
 from zope.generic.configuration import IConfigurations
 
@@ -79,25 +77,6 @@
 
 
 
-def queryConfigurationHandler(interface, default=None):
-    # cyclic import :(
-    from zope.generic.information.api import queryInformation
-    
-    info = queryInformation(interface, IConfigurationHandlerInformation, None)
-    
-    if info is None:
-        return default
-    
-    configuration = queryConfigurationData(info, IConfigurationHandlerConfiguration)
-    
-    if configuration is None:
-        return default
-
-    else:
-        return configuration.handler
-
-
-
 _marker = object()
 
 def configuratonToDict(interface, configuration, all=False):

Modified: zope.generic/trunk/src/zope/generic/configuration/interfaces.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/interfaces.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/interfaces.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -19,7 +19,7 @@
 __docformat__ = 'restructuredtext'
 
 from zope.app.event.interfaces import IModificationDescription
-from zope.app.event.interfaces import IObjectModifiedEvent
+from zope.app.event.interfaces import IObjectEvent
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.location import ILocation
 from zope.interface import Interface
@@ -31,7 +31,7 @@
 from zope.schema import Object
 from zope.schema import Tuple
 
-from zope.generic.component import IInterfaceKey
+from zope.generic.component import IKeyInterface
 from zope.generic.information import IInformation
 
 
@@ -83,7 +83,7 @@
 
 
 
-class IObjectConfigurationsModifiedEvent(IObjectModifiedEvent):
+class IObjectConfiguredEvent(IObjectEvent):
     """An object's configurations has been modified.
     
     The corresponding modifications will be attached on the description attribute
@@ -182,80 +182,3 @@
 class IConfigurationInformation(IInformation):
     """Information about a configuration."""
 
-
-
-class IConfigurationHandlerInformation(IInformation):
-    """Information about a configuration handler."""
-
-
-
-class IConfigurationHandlerType(IInterface):
-    """Type a configuration handler marker interface."""
-
-
-
-class IPrivateHandler(Interface):
-    """Mark a private configuration handler.
-
-    Configuration handlers marked by this marker should not be used from
-    other parties.
-
-    """
-
-alsoProvides(IPrivateHandler, IConfigurationHandlerType)
-
-
-
-missing = object()
-
-class IConfigurationHandler(IInterfaceKey):
-    """A configuration handler.
-
-    A handler marked by this type provides a certain configuration procdure 
-    functionality."""
-
-    interface = Object(
-        title=_('Interface'),
-        description=_('Interface marker that references corresponding informations.'),
-        default=IPrivateHandler,
-        schema=IConfigurationHandlerType)
-
-    passConfigurations = Bool(
-        title=_('Lookup Configurations?'),
-        description=_('Should component configurations be invoked by the handler'),
-        default=False)
-
-    passAnnotations = Bool(
-        title=_('Lookup Annotations?'),
-        description=_('Should component annotations be invoked by the handler'),
-        default=False)
-
-    def __call__(component, event, configurations=None, annotations=None):
-        """Configure the component.
-
-        A None value for annotations or configurations implies, that no 
-        configuration was looked up before.
-
-        If you couldn't look up a configurations or annotations you shoul
-        pass the missing marker object.
-
-        If configurations is missing or passConfigurations is False,
-        the handler should provide its own default configuration itself.
-
-        If annotations is missing or passAnnotations is False, 
-        the handler should provide its own default configuration itself.
-
-        """
-
-
-
-class IConfigurationHandlerConfiguration(Interface):
-    """The configuration for the configuration handler registration."""
-
-    handler = Object(
-        title=_('Configuration Handler'),
-        description=_('Registered configuration handler.'),
-        required=True,
-        schema=IConfigurationHandler)
-
-alsoProvides(IConfigurationHandlerConfiguration, IConfigurationType)

Modified: zope.generic/trunk/src/zope/generic/configuration/meta.zcml
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/meta.zcml	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/meta.zcml	2006-04-13 09:45:57 UTC (rev 66927)
@@ -10,12 +10,6 @@
         handler=".metaconfigure.configurationDirective"
         />
 
-    <meta:directive
-        name="configurationHandler"
-        schema=".metadirectives.IConfigurationHandlerDirective"
-        handler=".metaconfigure.configurationHandlerDirective"
-        />
-
   </meta:directives>
 
 </configure>

Modified: zope.generic/trunk/src/zope/generic/configuration/metaconfigure.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/metaconfigure.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/metaconfigure.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -19,25 +19,17 @@
 __docformat__ = 'restructuredtext'
 
 from zope.app.component.interface import provideInterface
-from zope.configuration.exceptions import ConfigurationError
 from zope.interface import alsoProvides
 
-from zope.generic.information.api import queryInformation
 from zope.generic.information.metaconfigure import provideInformation
 
-from zope.generic.configuration import IConfigurationHandler
-from zope.generic.configuration import IConfigurationHandlerConfiguration
-from zope.generic.configuration import IConfigurationHandlerInformation
-from zope.generic.configuration import IConfigurationHandlerType
 from zope.generic.configuration import IConfigurationInformation
 from zope.generic.configuration import IConfigurationType
 from zope.generic.configuration import IConfigurations
 
 from zope.generic.configuration.base import ConfigurationData
-from zope.generic.configuration.base import ConfigurationHandler
 
 
-
 def configurationDirective(_context, interface, label=None, hint=None):
     """Provide new configuration information."""
 
@@ -58,49 +50,4 @@
         discriminator = None,
         callable = provideInterface,
         args = (None, interface, iface_type),
-        )  
-
-
-def provideConfigurationHandlerConfiguration(interface, handler):
-    """Provide the handler to an configuration information."""
-    
-    registry = IConfigurationHandlerInformation
-    info = queryInformation(interface, IConfigurationHandlerInformation)
-
-    # this should never happen...
-    if info is None:
-        ConfigurationError('No configuration handler information for %s' 
-                           % interface.__name__)
-
-    # Eventually wrap a callable
-    if not IConfigurationHandler.providedBy(handler):
-        handler = ConfigurationHandler(handler, interface)
-
-    configurations = IConfigurations(info)
-    # create configuration data
-    data = ConfigurationData(IConfigurationHandlerConfiguration, {'handler': handler})
-    # set configuration data
-    configurations[IConfigurationHandlerConfiguration] = data
-
-
-
-def configurationHandlerDirective(_context, interface, handler, label=None, hint=None):
-    """Register a public configuration handler."""
-
-    # assert type as soon as possible
-    if not IConfigurationHandlerType.providedBy(interface):
-        alsoProvides(interface, IConfigurationHandlerType)
-
-    registry = IConfigurationHandlerInformation
-
-    _context.action(
-        discriminator = ('provideInformation', interface, registry),
-        callable = provideInformation,
-        args = (interface, registry, label, hint),
         )
-    
-    _context.action(
-        discriminator = ('provideConfigurationHandlerConfiguration', interface, handler),
-        callable = provideConfigurationHandlerConfiguration,
-        args = (interface, handler),
-        )

Modified: zope.generic/trunk/src/zope/generic/configuration/metadirectives.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/metadirectives.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/configuration/metadirectives.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -18,9 +18,6 @@
 
 __docformat__ = 'restructuredtext'
 
-from zope.app.i18n import ZopeMessageFactory as _
-from zope.configuration.fields import GlobalObject
-
 from zope.generic.information.metadirectives import IBaseInformationDirective
 
 
@@ -31,20 +28,3 @@
     Register configuration schema as interface utility typed by
     IConfigurationType within the configuration registry utility.    
     """
-
-
-
-class IConfigurationHandlerDirective(IBaseInformationDirective):
-    """Declare a public configuration handler.
-
-    Register configuration handler as interface utility typed by
-    IConfigurationHandlerType.
-    
-    """
-
-    handler = GlobalObject(
-        title=_('Configuration Handler'),
-        description=_('Configuration handler or callable with the signature' +
-                      '(componet, event, configuration=None, annotations=None).'),
-        required=True
-        )

Modified: zope.generic/trunk/src/zope/generic/information/NEW_README.txt
===================================================================
--- zope.generic/trunk/src/zope/generic/information/NEW_README.txt	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/information/NEW_README.txt	2006-04-13 09:45:57 UTC (rev 66927)
@@ -90,34 +90,34 @@
 
     >>> from zope.interface import implements
     >>> from zope.component import adapts
-    >>> from zope.generic.component import IInterfaceKey
+    >>> from zope.generic.component import IKeyInterface
 
     >>> class Logger(object):
     ...     """Generic logger adapter."""
     ...     implements(ILogger)
-    ...     adapts(IInterfaceKey)
+    ...     adapts(IKeyInterface)
     ...     def __init__(self, context):
     ...         self.context = context
     ...     def log(self, message):
-    ...         id = IInterfaceKey(self.context())
+    ...         id = IKeyInterface(self.context())
     ...         info = queryInformation(id.interface, ILogUserInformation)
     >>> class Logger(object):
     ...     """Generic logger adapter."""
     ...     implements(ILogger)
-    ...     adapts(IInterfaceKey)
+    ...     adapts(IKeyInterface)
     ...     def __init__(self, context):
     ...         self.context = context
     ...     def log(self, message):
-    ...         id = IInterfaceKey(self.context())
+    ...         id = IKeyInterface(self.context())
     ...         info = queryInformation(id.interface, ILogUserInformation)
     >>> class Logger(object):
     ...     """Generic logger adapter."""
     ...     implements(ILogger)
-    ...     adapts(IInterfaceKey)
+    ...     adapts(IKeyInterface)
     ...     def __init__(self, context):
     ...         self.context = context
     ...     def log(self, message):
-    ...         id = IInterfaceKey(self.context())
+    ...         id = IKeyInterface(self.context())
     ...         info = queryInformation(id.interface, ILogUserInformation)
 
 

Modified: zope.generic/trunk/src/zope/generic/information/base.py
===================================================================
--- zope.generic/trunk/src/zope/generic/information/base.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/information/base.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -24,7 +24,7 @@
 from zope.interface import implements
 
 from zope.generic.component.api import toDottedName
-from zope.generic.component.api import InterfaceKeyDescription
+from zope.generic.component.api import KeyInterfaceDescription
 from zope.generic.configuration import IAttributeConfigurable
 
 from zope.generic.information import IInformation
@@ -32,7 +32,7 @@
 
 
 
-class Information(InterfaceKeyDescription, dict):
+class Information(KeyInterfaceDescription, dict):
     """Default information.
 
     Information do relate a dedicated type of information marked as an interface

Modified: zope.generic/trunk/src/zope/generic/information/helper.py
===================================================================
--- zope.generic/trunk/src/zope/generic/information/helper.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/information/helper.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -22,7 +22,7 @@
 from zope.component import getUtilitiesFor
 from zope.interface.interfaces import IInterface
 
-from zope.generic.component import IInterfaceKey
+from zope.generic.component import IKeyInterface
 from zope.generic.component.api import toComponent
 from zope.generic.component.api import toDottedName
 
@@ -36,11 +36,11 @@
     if IInterface.providedBy(object):
         interface = object
 
-    elif IInterfaceKey.providedBy(object):
+    elif IKeyInterface.providedBy(object):
         interface = object.interface
 
     else:
-        interface = IInterfaceKey(object).interface
+        interface = IKeyInterface(object).interface
 
     return getUtility(registry, toDottedName(interface))
 

Modified: zope.generic/trunk/src/zope/generic/information/interfaces.py
===================================================================
--- zope.generic/trunk/src/zope/generic/information/interfaces.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/information/interfaces.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -26,11 +26,11 @@
 from zope.schema import Text
 from zope.schema import TextLine
 
-from zope.generic.component import IInterfaceKeyDescription
+from zope.generic.component import IKeyInterfaceDescription
 
 
 
-class IInformation(IInterfaceKeyDescription):
+class IInformation(IKeyInterfaceDescription):
     """Inform about an subject referenced by an interface-key.
 
     Additional information can be stored within the information's annotations

Modified: zope.generic/trunk/src/zope/generic/operation/interfaces.py
===================================================================
--- zope.generic/trunk/src/zope/generic/operation/interfaces.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/operation/interfaces.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -26,7 +26,7 @@
 from zope.schema import Object
 from zope.schema import Tuple
 
-from zope.generic.component import IInterfaceKey
+from zope.generic.component import IKeyInterface
 from zope.generic.configuration import IConfigurationType
 from zope.generic.information import IInformation
 from zope.generic.information import IInformationRegistryType
@@ -48,7 +48,7 @@
 
 
 
-class IOperation(IInterfaceKey):
+class IOperation(IKeyInterface):
     """Proceed operation"""
 
     def __call__(context, *pos, **kws):

Modified: zope.generic/trunk/src/zope/generic/type/interfaces.py
===================================================================
--- zope.generic/trunk/src/zope/generic/type/interfaces.py	2006-04-13 07:17:24 UTC (rev 66926)
+++ zope.generic/trunk/src/zope/generic/type/interfaces.py	2006-04-13 09:45:57 UTC (rev 66927)
@@ -25,8 +25,7 @@
 from zope.schema import Bool
 from zope.schema import Object
 
-from zope.generic.component import IInterfaceKey
-from zope.generic.configuration import IConfigurationHandler
+from zope.generic.component import IKeyInterface
 from zope.generic.configuration import IConfigurationType
 from zope.generic.directlyprovides import IProvides
 from zope.generic.information import IInformation
@@ -52,7 +51,7 @@
 
 
 
-class ITyped(ITypeable, IInterfaceKey):
+class ITyped(ITypeable, IKeyInterface):
     """Provid an information within the."""
 
     interface = Object(
@@ -63,7 +62,7 @@
 
 
 
-class IDirectlyTyped(ITyped, IProvides, IInterfaceKey):
+class IDirectlyTyped(ITyped, IProvides, IKeyInterface):
     """Directly provide the declared interface."""
 
     def __init__(interface, *pos, **kws):



More information about the Checkins mailing list