Skip to content

Commit

Permalink
Merge pull request #73 from zopefoundation/issue70
Browse files Browse the repository at this point in the history
Expose IComponent documentation.
  • Loading branch information
jamadden committed Jan 5, 2017
2 parents 7a1d23c + 295f659 commit 269710c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
16 changes: 13 additions & 3 deletions docs/adapter.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _adapter-registry:

================
Adapter Registry
================
==================
Adapter Registry
==================

Adapter registries provide a way to register objects that depend on
one or more interface specifications and provide (perhaps indirectly)
Expand Down Expand Up @@ -642,3 +642,13 @@ To register a handler, simply provide ``None`` as the provided interface:
>>> registry.subscribe([IRequire1], None, handler)
>>> registry.subscriptions([IRequire1], None) == [handler]
True


Components
==========

A :class:`zope.interface.registry.Components` object implements the
:class:`zope.interface.interfaces.IComponents` interface. This
interface uses multiple adapter registries to implement multiple
higher-level concerns (utilities, adapters and handlers), while also
providing event notifications and query capabilities.
29 changes: 26 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ Consider the following example:
>>> classImplementsOnly(C, I1, I2)
>>> [i.getName() for i in implementedBy(C)]
['I1', 'I2']

Instances of ``C`` provide only ``I1``, ``I2``, and regardless of
whatever interfaces instances of ``A`` and ``B`` implement.

Expand Down Expand Up @@ -447,7 +447,7 @@ Consider the following example:
>>> classImplementsOnly(C, I1, I2)
>>> [i.getName() for i in implementedBy(C)]
['I1', 'I2']

Instances of ``C`` provide only ``I1``, ``I2``, and regardless of
whatever interfaces instances of ``A`` and ``B`` implement.

Expand Down Expand Up @@ -699,7 +699,7 @@ include additional interfaces. For example:
>>> int(I2 in providedBy(ob))
0
>>> directlyProvides(ob, directlyProvidedBy(ob), I2)

adds ``I2`` to the interfaces directly provided by ``ob``:

.. doctest::
Expand Down Expand Up @@ -1078,3 +1078,26 @@ Usage
+++++

See :ref:`adapter-registry`.

``zope.interface.registry.Components``
--------------------------------------

API
+++

The component registry's API is defined by
``zope.interface.interfaces.IComponents``:

.. autointerface:: zope.interface.interfaces.IComponents
:members:
:member-order: bysource


.. autointerface:: zope.interface.interfaces.IComponentLookup
:members:
:member-order: bysource


.. autointerface:: zope.interface.interfaces.IComponentRegistry
:members:
:member-order: bysource
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
# built documents.
#
# The short X.Y version.
version = '4.0'
version = '4.3'
# The full version, including alpha/beta/rc tags.
release = '4.0.1'
release = '4.3.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 269710c

Please sign in to comment.