Clean up autodoc for manager classes

Use default settings instead of repeating the options
for each class.

Add docstrings for special methods that do not have them
so they appear in the output.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
This commit is contained in:
Doug Hellmann 2013-06-03 10:56:04 -04:00
parent 69e17801a3
commit fd365c497a
3 changed files with 9 additions and 21 deletions

View File

@ -251,3 +251,5 @@ texinfo_documents = [
extlinks = {
'issue': ('https://github.com/dreamhost/stevedore/issues/%s', 'issue '),
}
autodoc_default_flags = ['members', 'special-members', 'show-inheritance']

View File

@ -6,55 +6,36 @@ DriverManager
=============
.. autoclass:: stevedore.driver.DriverManager
:members:
:show-inheritance:
:special-members:
HookManager
===========
.. autoclass:: stevedore.hook.HookManager
:members:
:inherited-members:
:show-inheritance:
NamedExtensionManager
=====================
.. autoclass:: stevedore.named.NamedExtensionManager
:members:
:show-inheritance:
EnabledExtensionManager
=======================
.. autoclass:: stevedore.enabled.EnabledExtensionManager
:members:
:inherited-members:
:show-inheritance:
DispatchExtensionManager
========================
.. autoclass:: stevedore.dispatch.DispatchExtensionManager
:members:
:inherited-members:
:show-inheritance:
NameDispatchExtensionManager
============================
.. autoclass:: stevedore.dispatch.NameDispatchExtensionManager
:members:
:inherited-members:
:show-inheritance:
ExtensionManager
================
.. autoclass:: stevedore.extension.ExtensionManager
:members:
:show-inheritance:
Extension
=========
@ -62,10 +43,9 @@ Extension
.. autoclass:: stevedore.extension.Extension
:members:
:show-inheritance:
:no-special-members:
TestExtensionManager
====================
.. autoclass:: stevedore.tests.manager.TestExtensionManager
:members:
:show-inheritance:

View File

@ -45,6 +45,7 @@ class ExtensionManager(object):
the object returned by the entry point. Only used if invoke_on_load
is True.
:type invoke_kwds: dict
"""
def __init__(self, namespace,
@ -136,6 +137,11 @@ class ExtensionManager(object):
LOG.exception(err)
def __iter__(self):
"""Produce iterator for the manager.
Iterating over an ExtensionManager produces the :class:`Extension`
instances in the order they would be invoked.
"""
return iter(self.extensions)
def __getitem__(self, name):