docstrings and api
This commit is contained in:
@ -83,7 +83,7 @@ the first one is of course the `__setattr__` method
|
||||
|
||||
cfg.name = value
|
||||
|
||||
And if you wanna come back to a default value, do it the pythonic way::
|
||||
And if you wanna come back to a default value, use the builtin `del()` function::
|
||||
|
||||
del(cfg.name)
|
||||
|
||||
@ -103,46 +103,30 @@ A `Config` object is informed by an `option.OptionDescription`
|
||||
instance. The attributes of the ``Config`` objects are the names of the
|
||||
children of the ``OptionDescription``.
|
||||
|
||||
Here are the (useful) methods on ``Config``:
|
||||
|
||||
|
||||
With this `config.Config()` configuration management entry point,
|
||||
it is possible to
|
||||
|
||||
- `iter` on config, notice that there is an iteration order wich is
|
||||
the order of the :ref:`optdescr` specification entries,
|
||||
- compare two configs (equality),
|
||||
- export the whole config into a `dict` with `config.SubConfig.make_dict()`,
|
||||
|
||||
`option.Option()` objects in a config are iterable in the pythonic
|
||||
way, that is something like `[(name, value) for name, value in config]`.
|
||||
|
||||
To iter on groups in the same manner, use the
|
||||
`config.Config.iter_groups()` method wich yields generators too.
|
||||
Here are the (useful) methods on ``Config`` (or `SubConfig`).
|
||||
|
||||
.. currentmodule:: tiramisu.config
|
||||
|
||||
.. autoclass:: Config
|
||||
.. class:: Config
|
||||
|
||||
.. autoclass:: SubConfig
|
||||
:members: find, find_first, __iter__, iter_groups, iter_all, make_dict
|
||||
|
||||
.. automethod:: __init__
|
||||
|
||||
.. rubric:: Summary
|
||||
|
||||
.. autosummary::
|
||||
|
||||
find
|
||||
find_first
|
||||
|
||||
__iter__
|
||||
iter_groups
|
||||
iter_all
|
||||
|
||||
make_dict
|
||||
|
||||
.. rubric:: Methods
|
||||
|
||||
.. autosummary::
|
||||
|
||||
~Config.find
|
||||
~Config.find_first
|
||||
~Config.iter_groups
|
||||
~Config.__iter__
|
||||
|
||||
.. automethod:: find
|
||||
.. automethod:: find_first
|
||||
.. automethod:: iter_groups
|
||||
.. automethod:: __iter__
|
||||
|
||||
or a SubConfig, or a MetaConfig :
|
||||
|
||||
|
||||
.. autoclass:: SubConfig
|
||||
:members:
|
||||
:special-members:
|
||||
|
||||
|
@ -33,8 +33,8 @@ configuration handler.
|
||||
option
|
||||
status
|
||||
consistency
|
||||
glossary
|
||||
error
|
||||
glossary
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
Reference in New Issue
Block a user