Mercurial > hgrepos > Python > libs > ConfigMix
comparison docs/introduction.rst @ 316:fe2e28e5fd08
Docu: first short notes about configuration tree references
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 05 May 2021 09:22:00 +0200 |
| parents | 21fa4b4bfdaa |
| children | cffa4fcd0a4d |
comparison
equal
deleted
inserted
replaced
| 315:21fa4b4bfdaa | 316:fe2e28e5fd08 |
|---|---|
| 276 .. _variable-namespaces: | 276 .. _variable-namespaces: |
| 277 | 277 |
| 278 Variable Namespaces | 278 Variable Namespaces |
| 279 ------------------- | 279 ------------------- |
| 280 | 280 |
| 281 Currently there are 5 namespaces: | 281 Currently there are 6 namespaces: |
| 282 | 282 |
| 283 1. The unnamed namespace (which is also default). | 283 1. The unnamed namespace (which is also default). |
| 284 | 284 |
| 285 All the configuration variables are part of this namespace. | 285 All the configuration variables are part of this namespace. |
| 286 | 286 |
| 287 2. The namespace ``OS`` | 287 2. The namespace ``ref`` to be used for configuration references. |
| 288 | |
| 289 This is a namespace that is handled special within "ConfigMix". | |
| 290 | |
| 291 Must be Filters are **not** supported. | |
| 292 | |
| 293 3. The namespace ``OS`` | |
| 288 | 294 |
| 289 Available functions: | 295 Available functions: |
| 290 | 296 |
| 291 ``cwd`` | 297 ``cwd`` |
| 292 Contains the current working directory of the process | 298 Contains the current working directory of the process |
| 293 | 299 |
| 294 ``node`` | 300 ``node`` |
| 295 Contains the current node's computername (or whatever | 301 Contains the current node's computername (or whatever |
| 296 :py:func:`platform.node` returns) | 302 :py:func:`platform.node` returns) |
| 297 | 303 |
| 298 3. The namespace ``ENV`` | 304 4. The namespace ``ENV`` |
| 299 | 305 |
| 300 This namespace contains all the environment variables as they are | 306 This namespace contains all the environment variables as they are |
| 301 available from :py:data:`os.environ`. | 307 available from :py:data:`os.environ`. |
| 302 | 308 |
| 303 4. The namespace ``PY`` | 309 5. The namespace ``PY`` |
| 304 | 310 |
| 305 Contains selected values from the running Python: | 311 Contains selected values from the running Python: |
| 306 | 312 |
| 307 ``version`` | 313 ``version`` |
| 308 The return value of :py:func:`platform.python_version` | 314 The return value of :py:func:`platform.python_version` |
| 315 Just the major version of the running Python | 321 Just the major version of the running Python |
| 316 | 322 |
| 317 ``implementation`` | 323 ``implementation`` |
| 318 The return value of :py:func:`platform.python_implementation` | 324 The return value of :py:func:`platform.python_implementation` |
| 319 | 325 |
| 320 5. The namespace ``AWS`` | 326 6. The namespace ``AWS`` |
| 321 | 327 |
| 322 Contains some metadata for AWS instances when running from within | 328 Contains some metadata for AWS instances when running from within |
| 323 AWS: | 329 AWS: |
| 324 | 330 |
| 325 ``metadata.instance-id`` | 331 ``metadata.instance-id`` |
| 424 | 430 |
| 425 expands to something like ``CPYTHON`` when using the standard Python | 431 expands to something like ``CPYTHON`` when using the standard Python |
| 426 interpreter written in C. | 432 interpreter written in C. |
| 427 | 433 |
| 428 | 434 |
| 435 Configuration tree references | |
| 436 ----------------------------- | |
| 437 | |
| 438 With ``{{ref:my.other.key}}`` | |
| 439 | |
| 440 - special namespace ``ref`` | |
| 441 - No special handling when merging is done | |
| 442 - Keys within `.getvar_s()` and `.getvar()` are handled | |
| 443 - in `.getvar()` only, when it is the directly referenced value | |
| 444 - recursive expandion in `.getvar_s()` expands | |
| 445 | |
| 446 | |
| 429 Custom filename extensions and custom loaders | 447 Custom filename extensions and custom loaders |
| 430 --------------------------------------------- | 448 --------------------------------------------- |
| 431 | 449 |
| 432 If you want to have custom configuration file extensions and/or custom loaders | 450 If you want to have custom configuration file extensions and/or custom loaders |
| 433 for custom configuration files you have various possibilities: | 451 for custom configuration files you have various possibilities: |
