~bzr-pqm/bzr/bzr.dev

5743.3.7 by Vincent Ladeuil
Add some documentation about option and sections.
1
Configuring Bazaar
2
==================
3
4
A configuration option has:
5
6
- a name: a valid python identifier (even if it's not used as an
7
  identifier in python itself)
8
9
- a value: a unicode string
10
11
Sections
12
--------
13
14
Options are grouped into sections which share some properties with the well
15
known dict objects:
16
17
- the key is the name,
18
- you can get, set and remove an option,
19
- the value is a unicode string.
20
21
MutableSection are needed to set or remove an option, ReadOnlySection should
22
be used otherwise.
23
5743.4.16 by Vincent Ladeuil
Some doc for the stores.
24
Stores
25
------
26
27
Options can persistent in which case they are saved into Stores.
28
29
``config.Store`` defines the abstract interface that all stores should
30
implement.
31
32
This object doesn't provide a direct access to the options, it only provides
33
access to Sections. This is deliberate to ensure that sections can be properly
34
shared by reusing the same underlying objects. Accessing options should be
35
done via the ``Section`` objects.
36
37
A ``Store`` can contain one or more sections, each section is uniquely
38
identified by a unicode string.
39
40
``config.ConfigObjStore`` is an implementation that use ``ConfigObj``.
41
42
Depending on the object it is associated with (or not) a ``Store`` also needs
43
to implement a locking mechanism. ``LockableConfigObjStore`` implements such a
44
mechanism for ``ConfigObj`` based stores.