Update catalogs API docs

This commit is contained in:
Roman Mogilatov 2015-11-24 10:33:29 +02:00
parent 09de5a6021
commit 0a6e05657e

View File

@ -121,7 +121,15 @@ class CatalogBundle(object):
@six.python_2_unicode_compatible @six.python_2_unicode_compatible
class DynamicCatalog(object): class DynamicCatalog(object):
"""Dynamic catalog of providers.""" """Dynamic catalog of providers.
.. code-block:: python
services = DynamicCatalog(auth=providers.Factory(AuthService),
users=providers.Factory(UsersService))
users_service = services.users()
"""
__IS_CATALOG__ = True __IS_CATALOG__ = True
__slots__ = ('name', 'providers', 'provider_names', 'overridden_by', __slots__ = ('name', 'providers', 'provider_names', 'overridden_by',
@ -537,6 +545,16 @@ class DeclarativeCatalog(object):
defined in declarative manner. It should cover most of the cases when list defined in declarative manner. It should cover most of the cases when list
of providers that would be included in catalog is deterministic (catalog of providers that would be included in catalog is deterministic (catalog
will not change its structure in runtime). will not change its structure in runtime).
.. code-block:: python
class Services(DeclarativeCatalog):
auth = providers.Factory(AuthService)
users = providers.Factory(UsersService)
users_service = Services.users()
""" """
Bundle = CatalogBundle Bundle = CatalogBundle