1 ==================================
3 ==================================
5 What is options handling ?
6 =================================
8 Due to more and more available options required to set up an operating system,
9 compiler options or whatever, it became quite annoying to hand the necessary
10 options to where they are actually used and even more annoying to add new
11 options. To circumvent these problems the configuration control was
17 Tiramisu is an options handler and an options controller, which aims at
18 producing flexible and fast options access. The main advantages are its access
19 rules and the fact that the whole consistency is preserved at any time, see
20 :doc:`consistency`. There is of course type and structure validations, but also
21 validations towards the whole options. Furthermore, options can be reached and
22 changed according to the access rules from nearly everywhere in your appliance.
32 To obtain a copy of the sources, check it out from the repository using `git`.
33 We suggest using `git` if one wants to access to the current developments.
37 git clone git://git.labs.libre-entreprise.org/tiramisu.git
39 This will get you a fresh checkout of the code repository in a local directory
45 Option objects can be created in different ways. Let's perform very basic
46 :class:`~tiramisu.option.Option` and :class:`~tiramisu.config.Config` object
51 >>> from tiramisu.config import Config
52 >>> from tiramisu.option import OptionDescription, BoolOption
53 >>> # let's create a group of options... with only one option inside
54 >>> descr = OptionDescription("optgroup", "", [
55 ... BoolOption("bool", "", default=False)])
56 >>> # c is a namespace as well as a container for the options
66 - a namespace (which is `c` here)
67 - the access of an option's value by the
68 attribute access way (here `bool`, which is a boolean option
69 :class:`~tiramisu.option.BoolOption()`.
71 So, option objects are produced at the entry point `c` and then handed down to
72 where they are actually used when `c.bool` is triggered. This keeps options
73 local but available at any timer and consistent.
75 Once the namespace is created, we can set a
76 :meth:`~config.CommonConfig.read_write()` access to the options::
80 which enables us to set a bunch of access rules that we wil explain later in