Hello community,
here is the log from the commit of package python-zope.component for
openSUSE:Factory checked in at 2020-08-01 12:29:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zope.component (Old)
and /work/SRC/openSUSE:Factory/.python-zope.component.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zope.component"
Sat Aug 1 12:29:06 2020 rev:9 rq:822053 version:4.6.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-zope.component/python-zope.component.changes
2020-04-07 10:21:18.389828140 +0200
+++
/work/SRC/openSUSE:Factory/.python-zope.component.new.3592/python-zope.component.changes
2020-08-01 12:29:20.694353837 +0200
@@ -1,0 +2,6 @@
+Tue Jul 21 09:07:11 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to version 4.6.2
+ * Improve the documentation, both published and in docstrings.
+
+-------------------------------------------------------------------
Old:
----
zope.component-4.6.1.tar.gz
New:
----
zope.component-4.6.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-zope.component.spec ++++++
--- /var/tmp/diff_new_pack.NI3IDi/_old 2020-08-01 12:29:26.322359106 +0200
+++ /var/tmp/diff_new_pack.NI3IDi/_new 2020-08-01 12:29:26.326359110 +0200
@@ -27,7 +27,7 @@
%bcond_with test
%endif
Name: python-zope.component%{psuffix}
-Version: 4.6.1
+Version: 4.6.2
Release: 0
Summary: Zope Component Architecture
++++++ zope.component-4.6.1.tar.gz -> zope.component-4.6.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/CHANGES.rst
new/zope.component-4.6.2/CHANGES.rst
--- old/zope.component-4.6.1/CHANGES.rst 2020-03-23 14:02:44.000000000
+0100
+++ new/zope.component-4.6.2/CHANGES.rst 2020-07-03 17:25:02.000000000
+0200
@@ -2,6 +2,13 @@
Changes
=========
+4.6.2 (2020-07-03)
+==================
+
+- Improve the documentation, both published and in docstrings. See `PR
+ 49 <https://github.com/zopefoundation/zope.component/pull/49>`_.
+
+
4.6.1 (2020-03-23)
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/PKG-INFO
new/zope.component-4.6.2/PKG-INFO
--- old/zope.component-4.6.1/PKG-INFO 2020-03-23 14:02:45.246509000 +0100
+++ new/zope.component-4.6.2/PKG-INFO 2020-07-03 17:25:03.111320700 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: zope.component
-Version: 4.6.1
+Version: 4.6.2
Summary: Zope Component Architecture
Home-page: https://github.com/zopefoundation/zope.component
Author: Zope Foundation and Contributors
@@ -45,6 +45,13 @@
Changes
=========
+ 4.6.2 (2020-07-03)
+ ==================
+
+ - Improve the documentation, both published and in docstrings. See `PR
+ 49 <https://github.com/zopefoundation/zope.component/pull/49>`_.
+
+
4.6.1 (2020-03-23)
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/api/adapter.rst
new/zope.component-4.6.2/docs/api/adapter.rst
--- old/zope.component-4.6.1/docs/api/adapter.rst 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/docs/api/adapter.rst 2020-07-03
17:25:02.000000000 +0200
@@ -1,15 +1,24 @@
-Adapter Registration APIs
-=========================
+===========================
+ Adapter Registration APIs
+===========================
+
+This document covers a specific subset of the APIs in :mod:`zope.component`.
+
+.. currentmodule:: zope.component
.. testsetup::
from zope.component.testing import setUp
setUp()
-.. autofunction:: zope.component.provideUtility
+.. autofunction:: zope.component.provideAdapter
+
+.. autofunction:: zope.component.provideHandler
+
+.. autofunction:: zope.component.provideSubscriptionAdapter
Conforming Adapter Lookup
--------------------------
+=========================
.. autofunction:: zope.component.getAdapterInContext
@@ -21,7 +30,7 @@
If so, the object is returned immediately. Otherwise, the adapter factory
is looked up in the site manager, and called.
-Let's start by creating a component that supports the `__conform__()` method:
+Let's start by creating a component that supports the ``__conform__()`` method:
.. doctest::
@@ -39,14 +48,14 @@
to use in these tests.
We now have to create a site manager (other than the default global one)
-with which we can register adapters for `I1`.
+with which we can register adapters for ``I1``.
.. doctest::
>>> from zope.component.globalregistry import BaseGlobalComponents
>>> sitemanager = BaseGlobalComponents()
-Now we create a new `context` that knows how to get to our custom site
+Now we create a new ``context`` that knows how to get to our custom site
manager.
.. doctest::
@@ -111,7 +120,7 @@
43
Named Adapter Lookup
---------------------
+====================
.. autofunction:: zope.component.getAdapter
@@ -141,7 +150,7 @@
>>> queryAdapter(ob, I2, '', '<default>')
'<default>'
-The 'requires' argument to `registerAdapter` must be a sequence, rather than
+The 'requires' argument to ``registerAdapter`` must be a sequence, rather than
a single interface:
.. doctest::
@@ -154,7 +163,7 @@
...
TypeError: the required argument should be a list of interfaces, not a
single interface
-After register an adapter from `I1` to `I2` with the global site manager:
+After register an adapter from ``I1`` to ``I2`` with the global site manager:
.. doctest::
@@ -208,10 +217,10 @@
True
Invoking an Interface to Perform Adapter Lookup
------------------------------------------------
+===============================================
:mod:`zope.component` registers an adapter hook with
-:mod:`zope.interface.interface`, allowing a convenient spelling for
+`zope.interface.interface.adapter_hooks`, allowing a convenient spelling for
adapter lookup: just "call" the interface, passing the context:
.. doctest::
@@ -241,10 +250,10 @@
True
Registering Adapters For Arbitrary Objects
-------------------------------------------
+==========================================
Providing an adapter for None says that your adapter can adapt anything
-to `I2`.
+to ``I2``.
.. doctest::
@@ -267,7 +276,7 @@
True
Looking Up Adapters Using Multiple Objects
-------------------------------------------
+==========================================
.. autofunction:: zope.component.getMultiAdapter
@@ -284,7 +293,7 @@
As with regular adapters, if an adapter isn't registered for the given
objects and interface, the :func:`~zope.component.getMultiAdapter` API
-raises `ComponentLookupError`:
+raises `zope.interface.interfaces.ComponentLookupError`:
.. doctest::
@@ -342,7 +351,7 @@
Finding More Than One Adapter
------------------------------
+=============================
.. autofunction:: zope.component.getAdapters
@@ -388,17 +397,17 @@
Subscription Adapters
----------------------
+=====================
.. autofunction:: zope.component.subscribers
Event handlers
---------------
+==============
.. autofunction:: zope.component.handle
Helpers for Declaring / Testing Adapters
-----------------------------------------
+========================================
.. autofunction:: zope.component.adapter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/api/hooks.rst
new/zope.component-4.6.2/docs/api/hooks.rst
--- old/zope.component-4.6.1/docs/api/hooks.rst 1970-01-01 01:00:00.000000000
+0100
+++ new/zope.component-4.6.2/docs/api/hooks.rst 2020-07-03 17:25:02.000000000
+0200
@@ -0,0 +1,8 @@
+==========================================================
+ ``zope.component.hooks``: The current component registry
+==========================================================
+
+.. seealso:: :doc:`../hooks` for narrative documentation and examples.
+
+.. automodule:: zope.component.hooks
+ :noindex:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/api/module.rst
new/zope.component-4.6.2/docs/api/module.rst
--- old/zope.component-4.6.1/docs/api/module.rst 1970-01-01
01:00:00.000000000 +0100
+++ new/zope.component-4.6.2/docs/api/module.rst 2020-07-03
17:25:02.000000000 +0200
@@ -0,0 +1,12 @@
+============================================
+ ``zope.component``: Module-level functions
+============================================
+
+This document provides a summary of the APIs available directly from
+``zope.component``. For more details, see the remaining documentation.
+
+.. These are generally explored in more detail in
+ specific documentation, so default indexing should go
+ to that instead of here.
+.. automodule:: zope.component
+ :noindex:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/api/utility.rst
new/zope.component-4.6.2/docs/api/utility.rst
--- old/zope.component-4.6.1/docs/api/utility.rst 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/docs/api/utility.rst 2020-07-03
17:25:02.000000000 +0200
@@ -1,5 +1,8 @@
-Utility Registration APIs
-=========================
+===========================
+ Utility Registration APIs
+===========================
+
+.. autofunction:: zope.component.provideUtility
.. autofunction:: zope.component.getUtility
@@ -56,7 +59,7 @@
Named Utilities
----------------
+===============
Registering a utility without a name does not mean that it is available
when looking for the utility with a name:
@@ -84,7 +87,7 @@
True
Querying Multiple Utilities
----------------------------
+===========================
.. autofunction:: zope.component.getUtilitiesFor
@@ -159,7 +162,7 @@
Delegated Utility Lookup
-------------------------
+========================
.. autofunction:: zope.component.getNextUtility
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/api.rst
new/zope.component-4.6.2/docs/api.rst
--- old/zope.component-4.6.1/docs/api.rst 2020-03-23 14:02:44.000000000
+0100
+++ new/zope.component-4.6.2/docs/api.rst 2020-07-03 17:25:02.000000000
+0200
@@ -1,10 +1,12 @@
-:mod:`zope.component` API Reference
-===================================
+=====================================
+ ``zope.component`` API Reference
+=====================================
.. toctree::
:maxdepth: 2
+ api/module
api/interfaces
api/sitemanager
api/utility
@@ -13,3 +15,4 @@
api/interface
api/security
api/persistent
+ api/hooks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/changelog.rst
new/zope.component-4.6.2/docs/changelog.rst
--- old/zope.component-4.6.1/docs/changelog.rst 1970-01-01 01:00:00.000000000
+0100
+++ new/zope.component-4.6.2/docs/changelog.rst 2020-07-03 17:25:02.000000000
+0200
@@ -0,0 +1 @@
+.. include:: ../CHANGES.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/hooks.rst
new/zope.component-4.6.2/docs/hooks.rst
--- old/zope.component-4.6.1/docs/hooks.rst 2020-03-23 14:02:44.000000000
+0100
+++ new/zope.component-4.6.2/docs/hooks.rst 2020-07-03 17:25:02.000000000
+0200
@@ -74,6 +74,39 @@
>>> getSiteManager() is site2.registry
True
+However, the default `zope.component.getSiteManager` function isn't
+yet aware of this:
+
+.. doctest::
+
+ >>> from zope.component import getSiteManager as global_getSiteManager
+ >>> global_getSiteManager()
+ <BaseGlobalComponents base>
+
+To integrate that with the notion of the current site, we need to call
``setHooks``:
+
+.. autofunction:: setHooks
+
+.. doctest::
+
+ >>> from zope.component.hooks import setHooks
+ >>> setHooks()
+ >>> getSiteManager() is site2.registry
+ True
+ >>> global_getSiteManager() is site2.registry
+ True
+
+This can be reversed using ``resetHooks``:
+
+.. autofunction:: resetHooks
+
+.. doctest::
+
+ >>> from zope.component.hooks import resetHooks
+ >>> resetHooks()
+ >>> global_getSiteManager()
+ <BaseGlobalComponents base>
+
Finally we can unset the site and the global component registry is used again:
.. doctest::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/index.rst
new/zope.component-4.6.2/docs/index.rst
--- old/zope.component-4.6.1/docs/index.rst 2020-03-23 14:02:44.000000000
+0100
+++ new/zope.component-4.6.2/docs/index.rst 2020-07-03 17:25:02.000000000
+0200
@@ -4,6 +4,11 @@
Contents:
.. toctree::
+ :maxdepth: 1
+
+ changelog
+
+.. toctree::
:maxdepth: 2
narr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/docs/testlayer.rst
new/zope.component-4.6.2/docs/testlayer.rst
--- old/zope.component-4.6.1/docs/testlayer.rst 2020-03-23 14:02:44.000000000
+0100
+++ new/zope.component-4.6.2/docs/testlayer.rst 2020-07-03 17:25:02.000000000
+0200
@@ -4,6 +4,8 @@
.. currentmodule:: zope.component.testlayer
+.. module:: zope.component.testlayer
+
``zope.component.testlayer`` defines two things:
* a `LayerBase` that makes it easier and saner to use zope.testing's
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/setup.py
new/zope.component-4.6.2/setup.py
--- old/zope.component-4.6.1/setup.py 2020-03-23 14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/setup.py 2020-07-03 17:25:02.000000000 +0200
@@ -62,7 +62,7 @@
setup(
name='zope.component',
- version='4.6.1',
+ version='4.6.2',
url='https://github.com/zopefoundation/zope.component',
license='ZPL 2.1',
description='Zope Component Architecture',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/src/zope/component/__init__.py
new/zope.component-4.6.2/src/zope/component/__init__.py
--- old/zope.component-4.6.1/src/zope/component/__init__.py 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/__init__.py 2020-07-03
17:25:02.000000000 +0200
@@ -11,7 +11,16 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Zope 3 Component Architecture
+"""
+Zope 3 Component Architecture
+
+This module provides an implementation of
+:class:`~zope.component.interfaces.IComponentArchitecture`, using the
+current :mod:`site <zope.component.hooks>`.
+
+This module also provides an implementation of
+:class:`~zope.component.interfaces.IComponentRegistrationConvenience`
+using the `global site manager <getGlobalSiteManager>`_.
"""
from zope.interface import Interface
from zope.interface import implementedBy
@@ -58,4 +67,9 @@
from zope.component._declaration import adapts
moduleProvides(IComponentArchitecture, IComponentRegistrationConvenience)
-__all__ = tuple(IComponentArchitecture)
+__all__ = tuple(IComponentArchitecture) +
tuple(IComponentRegistrationConvenience) + (
+ 'named',
+ 'adapts',
+ 'adapter',
+ 'adaptedBy',
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/src/zope/component/_api.py
new/zope.component-4.6.2/src/zope/component/_api.py
--- old/zope.component-4.6.1/src/zope/component/_api.py 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/_api.py 2020-07-03
17:25:02.000000000 +0200
@@ -21,12 +21,15 @@
from zope.interface.interfaces import IComponentLookup
from zope.component.interfaces import IFactory
+from zope.component.interfaces import inherits_arch_docs as inherits_docs
+
# getSiteManager() returns a component registry. Although the term
# "site manager" is deprecated in favor of "component registry",
# the old term is kept around to maintain a stable API.
base = None
@hookable
+@inherits_docs
def getSiteManager(context=None):
""" See IComponentArchitecture.
"""
@@ -44,13 +47,14 @@
raise ComponentLookupError(*error.args)
# Adapter API
-
+@inherits_docs
def getAdapterInContext(object, interface, context):
adapter = queryAdapterInContext(object, interface, context)
if adapter is None:
raise ComponentLookupError(object, interface)
return adapter
+@inherits_docs
def queryAdapterInContext(object, interface, context, default=None):
conform = getattr(object, '__conform__', None)
if conform is not None:
@@ -78,12 +82,14 @@
return getSiteManager(context).queryAdapter(object, interface, '', default)
+@inherits_docs
def getAdapter(object, interface=Interface, name=u'', context=None):
adapter = queryAdapter(object, interface, name, None, context)
if adapter is None:
raise ComponentLookupError(object, interface, name)
return adapter
+@inherits_docs
def queryAdapter(object, interface=Interface, name=u'', default=None,
context=None):
if context is None:
@@ -91,12 +97,14 @@
return getSiteManager(context).queryAdapter(object, interface, name,
default)
+@inherits_docs
def getMultiAdapter(objects, interface=Interface, name=u'', context=None):
adapter = queryMultiAdapter(objects, interface, name, context=context)
if adapter is None:
raise ComponentLookupError(objects, interface, name)
return adapter
+@inherits_docs
def queryMultiAdapter(objects, interface=Interface, name=u'', default=None,
context=None):
try:
@@ -107,6 +115,7 @@
return sitemanager.queryMultiAdapter(objects, interface, name, default)
+@inherits_docs
def getAdapters(objects, provided, context=None):
try:
sitemanager = getSiteManager(context)
@@ -115,6 +124,7 @@
return []
return sitemanager.getAdapters(objects, provided)
+@inherits_docs
def subscribers(objects, interface, context=None):
try:
sitemanager = getSiteManager(context)
@@ -123,6 +133,7 @@
return []
return sitemanager.subscribers(objects, interface)
+@inherits_docs
def handle(*objects):
getSiteManager(None).subscribers(objects, None)
@@ -146,26 +157,29 @@
# Utility API
-
+@inherits_docs
def getUtility(interface, name='', context=None):
utility = queryUtility(interface, name, context=context)
if utility is not None:
return utility
raise ComponentLookupError(interface, name)
+@inherits_docs
def queryUtility(interface, name='', default=None, context=None):
return getSiteManager(context).queryUtility(interface, name, default)
+@inherits_docs
def getUtilitiesFor(interface, context=None):
return getSiteManager(context).getUtilitiesFor(interface)
-
+@inherits_docs
def getAllUtilitiesRegisteredFor(interface, context=None):
return getSiteManager(context).getAllUtilitiesRegisteredFor(interface)
_marker = object()
+@inherits_docs
def queryNextUtility(context, interface, name='', default=None):
"""Query for the next available utility.
@@ -184,7 +198,7 @@
return util
return default
-
+@inherits_docs
def getNextUtility(context, interface, name=''):
"""Get the next available utility.
@@ -200,6 +214,7 @@
# Factories
+@inherits_docs
def createObject(__factory_name, *args, **kwargs):
"""Invoke the named factory and return the result.
@@ -208,6 +223,7 @@
context = kwargs.pop('context', None)
return getUtility(IFactory, __factory_name, context)(*args, **kwargs)
+@inherits_docs
def getFactoryInterfaces(name, context=None):
"""Return the interface provided by the named factory's objects
@@ -215,6 +231,7 @@
"""
return getUtility(IFactory, name, context).getInterfaces()
+@inherits_docs
def getFactoriesFor(interface, context=None):
"""Return info on all factories implementing the given interface.
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.1/src/zope/component/_declaration.py
new/zope.component-4.6.2/src/zope/component/_declaration.py
--- old/zope.component-4.6.1/src/zope/component/_declaration.py 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/_declaration.py 2020-07-03
17:25:02.000000000 +0200
@@ -18,7 +18,13 @@
from zope.component._compat import CLASS_TYPES
class adapter(object):
-
+ """
+ Decorator that declares that the decorated object adapts the given
+ *interfaces*.
+
+ This is commonly used in conjunction with :obj:`zope.interface.implementer`
+ to declare what adapting the *interfaces* will provide.
+ """
def __init__(self, *interfaces):
self.interfaces = interfaces
@@ -44,6 +50,9 @@
locals['__component_adapts__'] = _adapts_descr(interfaces)
def adaptedBy(ob):
+ """
+ Return the *interfaces* that *ob* will adapt, as declared by
:obj:`adapter`.
+ """
return getattr(ob, '__component_adapts__', None)
def getName(ob):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.1/src/zope/component/globalregistry.py
new/zope.component-4.6.2/src/zope/component/globalregistry.py
--- old/zope.component-4.6.1/src/zope/component/globalregistry.py
2020-03-23 14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/globalregistry.py
2020-07-03 17:25:02.000000000 +0200
@@ -13,11 +13,11 @@
##############################################################################
"""Global components support
"""
-from zope.interface import implementer
from zope.interface.adapter import AdapterRegistry
from zope.interface.registry import Components
-from zope.interface.interfaces import IComponentLookup
+from zope.component.interfaces import inherits_arch_docs
+from zope.component.interfaces import inherits_reg_docs
def GAR(components, registryName):
@@ -59,6 +59,7 @@
del addCleanUp
globalSiteManager = base
+@inherits_arch_docs
def getGlobalSiteManager():
return globalSiteManager
@@ -66,14 +67,18 @@
# We eventually want to deprecate these in favor of using the global
# component registry directly.
+@inherits_reg_docs
def provideUtility(component, provides=None, name=u''):
base.registerUtility(component, provides, name, event=False)
+@inherits_reg_docs
def provideAdapter(factory, adapts=None, provides=None, name=u''):
base.registerAdapter(factory, adapts, provides, name, event=False)
+@inherits_reg_docs
def provideSubscriptionAdapter(factory, adapts=None, provides=None):
base.registerSubscriptionAdapter(factory, adapts, provides, event=False)
+@inherits_reg_docs
def provideHandler(factory, adapts=None):
base.registerHandler(factory, adapts, event=False)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.component-4.6.1/src/zope/component/hooks.py
new/zope.component-4.6.2/src/zope/component/hooks.py
--- old/zope.component-4.6.1/src/zope/component/hooks.py 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/hooks.py 2020-07-03
17:25:02.000000000 +0200
@@ -30,6 +30,14 @@
from zope.interface.interfaces import ComponentLookupError
from zope.interface.interfaces import IComponentLookup
+__all__ = [
+ 'setSite',
+ 'getSite',
+ 'site',
+ 'getSiteManager',
+ 'setHooks',
+ 'resetHooks',
+]
class read_property(object):
"""Descriptor for property-like computed attributes.
@@ -130,11 +138,32 @@
def setHooks():
+ """
+ Make `zope.component.getSiteManager` and interface adaptation
+ respect the current site.
+
+ Most applications will want to be sure te call this early in their
+ startup sequence. Test code that uses these APIs should also arrange to
+ call this.
+
+ .. seealso:: :mod:`zope.component.testlayer`
+ """
from zope.component import _api
_api.adapter_hook.sethook(adapter_hook)
_api.getSiteManager.sethook(getSiteManager)
def resetHooks():
+ """
+ Reset `zope.component.getSiteManager` and interface adaptation to
+ their original implementations that are unaware of the current
+ site.
+
+ Use caution when calling this; most code will not need to call
+ this. If code using the global API executes following this, it
+ will most likely use the base global component registry instead of
+ a site-specific registry it was expected. This can lead to
+ failures in adaptation and utility lookup.
+ """
# Reset hookable functions to original implementation.
from zope.component import _api
_api.adapter_hook.reset()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.1/src/zope/component/interfaces.py
new/zope.component-4.6.2/src/zope/component/interfaces.py
--- old/zope.component-4.6.1/src/zope/component/interfaces.py 2020-03-23
14:02:44.000000000 +0100
+++ new/zope.component-4.6.2/src/zope/component/interfaces.py 2020-07-03
17:25:02.000000000 +0200
@@ -11,7 +11,11 @@
# FOR A PARTICULAR PURPOSE.
#
############################################################################
-"""Component and Component Architecture Interfaces
+"""
+Component and Component Architecture Interfaces
+
+The `IComponentArchitecture` and `IComponentRegistrationConvenience` interfaces
+are provided by `zope.component` directly.
"""
from zope.interface import Attribute
from zope.interface import Interface
@@ -380,3 +384,24 @@
created by this factory will implement. If the callable's Implements
instance cannot be created, an empty Implements instance is returned.
"""
+
+
+# Internal helpers
+
+def _inherits_docs(func, iface):
+ doc = iface[func.__name__].__doc__
+ # By adding the ..seealso:: we get a link from our overview page
+ # to the specific narrative place where the function is described, because
+ # our overview page uses :noindex:
+ doc += "\n .. seealso::"
+ doc += "\n Function `~zope.component.%s` for notes, and " %
(func.__name__,)
+ doc += "\n `~zope.component.interfaces.%s` for the defining
interface." % (iface.__name__,)
+ doc += "\n"
+ func.__doc__ = doc
+ return func
+
+def inherits_arch_docs(func):
+ return _inherits_docs(func, IComponentArchitecture)
+
+def inherits_reg_docs(func):
+ return _inherits_docs(func, IComponentRegistrationConvenience)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.1/src/zope.component.egg-info/PKG-INFO
new/zope.component-4.6.2/src/zope.component.egg-info/PKG-INFO
--- old/zope.component-4.6.1/src/zope.component.egg-info/PKG-INFO
2020-03-23 14:02:45.000000000 +0100
+++ new/zope.component-4.6.2/src/zope.component.egg-info/PKG-INFO
2020-07-03 17:25:02.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: zope.component
-Version: 4.6.1
+Version: 4.6.2
Summary: Zope Component Architecture
Home-page: https://github.com/zopefoundation/zope.component
Author: Zope Foundation and Contributors
@@ -45,6 +45,13 @@
Changes
=========
+ 4.6.2 (2020-07-03)
+ ==================
+
+ - Improve the documentation, both published and in docstrings. See `PR
+ 49 <https://github.com/zopefoundation/zope.component/pull/49>`_.
+
+
4.6.1 (2020-03-23)
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.component-4.6.1/src/zope.component.egg-info/SOURCES.txt
new/zope.component-4.6.2/src/zope.component.egg-info/SOURCES.txt
--- old/zope.component-4.6.1/src/zope.component.egg-info/SOURCES.txt
2020-03-23 14:02:45.000000000 +0100
+++ new/zope.component-4.6.2/src/zope.component.egg-info/SOURCES.txt
2020-07-03 17:25:02.000000000 +0200
@@ -13,6 +13,7 @@
tox.ini
docs/Makefile
docs/api.rst
+docs/changelog.rst
docs/conf.py
docs/configure.rst
docs/event.rst
@@ -29,8 +30,10 @@
docs/_static/.gitignore
docs/api/adapter.rst
docs/api/factory.rst
+docs/api/hooks.rst
docs/api/interface.rst
docs/api/interfaces.rst
+docs/api/module.rst
docs/api/persistent.rst
docs/api/security.rst
docs/api/sitemanager.rst