Mercurial > p > roundup > code
comparison doc/reference.txt @ 7875:d4f6ba8e3c1e
doc: clarify use of DEFAULT section and interpolation in config files.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 14 Apr 2024 20:08:29 -0400 |
| parents | 6c219034bf31 |
| children | 6aa0525187cd |
comparison
equal
deleted
inserted
replaced
| 7874:a363bb8c0ed4 | 7875:d4f6ba8e3c1e |
|---|---|
| 111 dir = frob | 111 dir = frob |
| 112 | 112 |
| 113 would resolve the "%(dir)s" to the value of "dir" ("frob" in this case) | 113 would resolve the "%(dir)s" to the value of "dir" ("frob" in this case) |
| 114 resulting in "foodir" being "frob/whatever". | 114 resulting in "foodir" being "frob/whatever". |
| 115 | 115 |
| 116 The reference above discusses using the ``[DEFAULT]`` section and | |
| 117 interpolation. For example:: | |
| 118 | |
| 119 [DEFAULT] | |
| 120 local_admin_email = admin@example.com | |
| 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 (``admin@example.com``). 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 | |
| 116 __ https://docs.python.org/2/library/configparser.html | 136 __ https://docs.python.org/2/library/configparser.html |
| 117 | 137 |
| 118 Example configuration settings are below. This is a partial list. The | 138 Example configuration settings are below. This is a partial list. The |
| 119 ``config.ini`` file includes documentation on all the settings. | 139 ``config.ini`` file includes documentation on all the settings. |
| 120 | 140 |
| 582 | 602 |
| 583 - a config.ini in the ``extensions`` directory is loaded and attached | 603 - a config.ini in the ``extensions`` directory is loaded and attached |
| 584 to the config variable as "ext". | 604 to the config variable as "ext". |
| 585 - a config.ini in the ``detectors`` directory is loaded and attached | 605 - a config.ini in the ``detectors`` directory is loaded and attached |
| 586 to the config variable as "detectors". | 606 to the config variable as "detectors". |
| 607 | |
| 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. | |
| 587 | 613 |
| 588 For example, the following in ``detectors/config.ini``:: | 614 For example, the following in ``detectors/config.ini``:: |
| 589 | 615 |
| 590 [main] | 616 [main] |
| 591 qa_recipients = email@example.com | 617 qa_recipients = email@example.com |
