/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/configuration.txt

  • Committer: Andrew Bennetts
  • Date: 2011-06-02 07:25:33 UTC
  • mfrom: (5952 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5955.
  • Revision ID: andrew.bennetts@canonical.com-20110602072533-v0pe1ivh27cp0pd8
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
A configuration option has:
5
5
 
6
 
- a name: a valid python identifier (even if it's not used as an
 
6
* a name: a valid python identifier (even if it's not used as an
7
7
  identifier in python itself)
8
8
 
9
 
- a value: a unicode string
 
9
* a value: a unicode string
 
10
 
 
11
Option
 
12
------
 
13
 
 
14
The Option object is used to define its properties:
 
15
 
 
16
* name: a name: a valid python identifier (even if it's not used as an
 
17
  identifier in python itself). This is also used to register the option.
 
18
 
 
19
* default: the default value that Stack.get() should return if no
 
20
  value can be found for the option.
 
21
 
 
22
Since plugins should be able to lazily register options, the associated help
 
23
is not part of the object but provided at registration time.
10
24
 
11
25
Sections
12
26
--------
14
28
Options are grouped into sections which share some properties with the well
15
29
known dict objects:
16
30
 
17
 
- the key is the name,
18
 
- you can get, set and remove an option,
19
 
- the value is a unicode string.
 
31
* the key is the name,
 
32
* you can get, set and remove an option,
 
33
* the value is a unicode string.
20
34
 
21
35
MutableSection is needed to set or remove an option, ReadOnlySection should
22
36
be used otherwise.
95
109
A ``Stack`` defines a mutable section when there is no ambiguity.  If there
96
110
is one, then the *user* should be able to decide and in this case a new
97
111
``Stack`` can be created cheaply.
 
112
 
 
113
Different stacks can be created for different purposes, the existing
 
114
``GlobalStack``, ``LocationStack`` and ``BranchStack`` can be used as basis
 
115
or examples. These classes are the only ones that should be used in code,
 
116
``Stores`` can be used to build them but shouldn't be used otherwise, ditto
 
117
for sections. Again, the associated tests could and should be used against the
 
118
created stacks.