Skip to content

Commit 80b804d

Browse files
committed
doc: clarify use of DEFAULT section and interpolation in config files.
1 parent 625465d commit 80b804d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

doc/reference.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,26 @@ section "ConfigParser -- Configuration file parser":
113113
would resolve the "%(dir)s" to the value of "dir" ("frob" in this case)
114114
resulting in "foodir" being "frob/whatever".
115115

116+
The reference above discusses using the ``[DEFAULT]`` section and
117+
interpolation. For example::
118+
119+
[DEFAULT]
120+
local_admin_email = [email protected]
121+
122+
[main]
123+
admin_email = %(local_admin_email)s
124+
125+
will set the admin_email setting. This works when running the
126+
tracker. When upgrading Roundup using ``updateconfig`` to create
127+
a new ``config.ini``, the ``DEFAULT`` section is not preserved
128+
and interpolation tokens (e.g. ``%(local_admin_email)s`` are
129+
replaced with their values (``[email protected]``). This may be
130+
fixed in a future release of Roundup.
131+
132+
Note that you can not reference settings in the ``DEFAULT``
133+
section from Roundup. They are only useful when interpolated into
134+
a defined setting.
135+
116136
__ https://docs.python.org/2/library/configparser.html
117137

118138
Example configuration settings are below. This is a partial list. The
@@ -585,6 +605,12 @@ you can add two new config.ini files:
585605
- a config.ini in the ``detectors`` directory is loaded and attached
586606
to the config variable as "detectors".
587607

608+
These configuration files support the same operations as the main
609+
``config.ini`` file. This included a ``DEFAULT`` section and
610+
interpolation. Note that you can not reference settings in the
611+
``DEFAULT`` section from Roundup. They can only be used for
612+
interpolation.
613+
588614
For example, the following in ``detectors/config.ini``::
589615

590616
[main]

0 commit comments

Comments
 (0)