2012-07-13 09:40:48 +02:00
|
|
|
|
==================================
|
2013-05-17 12:11:14 +02:00
|
|
|
|
Getting started
|
2012-07-13 09:40:48 +02:00
|
|
|
|
==================================
|
|
|
|
|
|
|
|
|
|
What is Configuration handling ?
|
2012-11-20 17:14:58 +01:00
|
|
|
|
=================================
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2012-11-20 17:14:58 +01:00
|
|
|
|
Due to more and more available configuration options required to set up
|
|
|
|
|
an operating system, it became quite annoying to hand the necessary
|
|
|
|
|
options to where they are actually used and even more annoying to add
|
|
|
|
|
new options. To circumvent these problems the configuration management
|
2013-05-15 17:35:49 +02:00
|
|
|
|
was introduced...
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
|
|
|
|
What is Tiramisu ?
|
2012-11-20 17:14:58 +01:00
|
|
|
|
===================
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
Tiramisu is yet another configuration handler, wich aims at producing flexible
|
|
|
|
|
and fast configuration options access. The main advantages are its access rules
|
|
|
|
|
and the fact that the configuration's consistency is preserved at any time, see
|
|
|
|
|
:doc:`consistency`. There is of course type and structure validations, but also
|
|
|
|
|
validations towards the whole configuration.
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2012-11-20 17:14:58 +01:00
|
|
|
|
Last but not least, configuration options can be reached and changed
|
2013-05-15 17:35:49 +02:00
|
|
|
|
according to the access rules from nearly everywhere in your appliance.
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2012-11-20 17:14:58 +01:00
|
|
|
|
Just the facts
|
|
|
|
|
==============
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2012-11-20 17:14:58 +01:00
|
|
|
|
.. _gettingtiramisu:
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
|
|
|
|
Download
|
|
|
|
|
---------
|
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
To obtain a copy of the sources, check it out from the repository using `git`.
|
|
|
|
|
We suggest using `git` if one wants to access the current developments.
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
git clone git://git.labs.libre-entreprise.org/tiramisu.git
|
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
This will get you a fresh checkout of the code repository in a local directory
|
|
|
|
|
named ``tiramisu``.
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
Getting started
|
|
|
|
|
-------------------
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
Configuration option objects can be created in different ways. Let's perform
|
|
|
|
|
very basic :class:`tiramisu.config.Config` object manipulations:
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
::
|
2012-07-13 09:40:48 +02:00
|
|
|
|
|
2013-05-15 17:35:49 +02:00
|
|
|
|
>>> from tiramisu.config import Config
|
|
|
|
|
>>> from tiramisu.option import OptionDescription, BoolOption
|
|
|
|
|
>>> descr = OptionDescription("optgroup", "", [
|
|
|
|
|
... BoolOption("bool", "", default=False)])
|
|
|
|
|
>>>
|
|
|
|
|
>>> config = Config(descr)
|
|
|
|
|
>>> # now we have a config, wich contains an option:
|
|
|
|
|
>>> config.bool
|
|
|
|
|
False
|
|
|
|
|
>>> config.bool = True
|
|
|
|
|
>>> config.bool
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So by now, we have
|
|
|
|
|
|
|
|
|
|
- a namespace (which is `config` here)
|
|
|
|
|
- the access of an option's value by the
|
|
|
|
|
attribute access way (here `bool`, wich is a boolean option:
|
|
|
|
|
:class:`tiramisu.option.BoolOption()`.
|
|
|
|
|
|
|
|
|
|
Configuration option objects :class:`tiramisu.config.Config()` are produced at
|
|
|
|
|
the entry points and handed down to where they are actually used. This keeps
|
|
|
|
|
configuration local but available everywhere and consistent.
|