~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/configuration.txt

  • Committer: Jelmer Vernooij
  • Date: 2011-10-04 22:20:49 UTC
  • mto: This revision was merged to the branch mainline in revision 6190.
  • Revision ID: jelmer@samba.org-20111004222049-d9glniyleu0pppzd
Add a load_plugin_translations method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
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 or a list of unicode strings.
10
10
 
11
11
Option
12
12
------
19
19
* default: the default value that Stack.get() should return if no
20
20
  value can be found for the option.
21
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.
 
22
* default_from_env: a list of environment variables. The first variable set
 
23
  will provide a default value overriding 'default' which remains the
 
24
  default value if *no* environment variable is set.
 
25
 
 
26
* help: a doc string describing the option, the first line should be a
 
27
  summary and can be followed by a blank line and a more detailed
 
28
  explanation.
 
29
 
 
30
* from_unicode: a callable accepting a unicode string and returning a
 
31
  suitable value for the option. If the string cannot be coerced it should
 
32
  return None.
 
33
 
 
34
* invalid: the action to be taken when an invalid value is encountered in a
 
35
  store (during a Stack.get()).
24
36
 
25
37
Sections
26
38
--------
74
86
all data needed for the selection and uses it while processing the sections in
75
87
``get_sections``.
76
88
 
77
 
Only ``ReadOnlySection`` objects are manipulated here but a ``SectionMatcher``
78
 
can return dedicated ``Section`` to provide additional context (the
79
 
``LocationSection`` add an ``extra_path`` attribute to implement the
80
 
``appendpath`` policy for example).
 
89
Only ``ReadOnlySection`` objects are manipulated here but a
 
90
``SectionMatcher`` can return dedicated ``Section`` objects to provide
 
91
additional context (the ``LocationSection`` add an ``extra_path`` attribute
 
92
to implement the ``appendpath`` policy for example). If no sections match,
 
93
an empty list is returned.
81
94
 
82
95
.. FIXME: Replace the appendpath example if/when it's deprecated ;)
83
96
 
 
97
Specific section matchers can be implemented by overriding ``get_sections``
 
98
or just ``match``.
 
99
 
 
100
``bzrlib`` provides:
 
101
 
 
102
* ``LocationMatcher(store, location)``: To select all sections that match
 
103
  ``location``.
 
104
 
 
105
* ``NameMatcher(store, unique_id)``: To select a single section matching
 
106
  ``unique_id``.
 
107
 
84
108
Stacks
85
109
------
86
110