documentation update and docstrings
This commit is contained in:
@ -61,6 +61,11 @@ Let's make the protocol of accessing a config's attribute explicit
|
||||
4. If an option is declared, and a value has been set, the returned value is
|
||||
the value of the option.
|
||||
|
||||
But there are special exceptions. We will see later on that an option can be a
|
||||
:term:`mandatory option`. A mandatory option is an option that must have a defined value.
|
||||
If no value have been set yet, the value is `None`.
|
||||
When the option is called to retrieve a value, an exception is raised.
|
||||
|
||||
What if a value has been set and `None` is to be returned again ? Don't
|
||||
worry, an option value can be "reseted" with the help of the `option.Option.reset()`
|
||||
method.
|
||||
@ -130,3 +135,9 @@ Here are the (useful) methods on ``Config`` (or `SubConfig`).
|
||||
.. rubric:: Methods
|
||||
|
||||
|
||||
A :class:`~config.CommonConfig` is a abstract base class. A
|
||||
:class:`~config.SubConfig` is an just in time created objects that wraps an
|
||||
::class:`~option.OptionDescription`. A SubConfig differs from a Config in the
|
||||
::fact that a config is a root object and has an environnement, a context wich
|
||||
::defines the different properties, access rules, vs... There is generally only
|
||||
::one Config, and many SubConfigs.
|
||||
|
@ -30,6 +30,19 @@ of the same type.
|
||||
For example, an :class:`option.IntOption` validator waits for an `int` object of
|
||||
course, an :class:`option.StrOption` validator waits for an `str`, vs...
|
||||
|
||||
|
||||
Where are located the values
|
||||
-------------------------------
|
||||
|
||||
The entry point of the acces to the values is the :class:`setting.Setting()` of
|
||||
the root configuration object, but the values are actually located in the
|
||||
:class:`value.Values()` object, in order to be delegated in some kind of a
|
||||
`tiramisu.storage`, which can be a in-memory storage, or a persistent (for the
|
||||
time being, a sqlite3) storage.
|
||||
|
||||
:class:`value.Values()` is also responsible of the owners and the calculation
|
||||
of the options that have callbacks.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
@ -76,3 +89,15 @@ modified at the first calculation.
|
||||
.. automodule:: tiramisu.autolib
|
||||
:members:
|
||||
|
||||
This is the typically protocol for accessing a option's for a calculated value,
|
||||
but some twisted ways are also possible, take a look at the `force_store_value`
|
||||
attribute.
|
||||
|
||||
.. glossary::
|
||||
|
||||
force store value
|
||||
|
||||
A calculated value (that is, an option that has a callback) with the
|
||||
attribute `force_store_value` enabled is considered to be modified at
|
||||
the first calculation
|
||||
|
||||
|
Reference in New Issue
Block a user