Mercurial > hgrepos > Python > libs > ConfigMix
comparison docs/introduction.rst @ 389:44ef854da70a
Docs
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 10 Nov 2021 09:37:44 +0100 |
| parents | b2c0550d5a44 |
| children | 727ec2fc8e7e |
comparison
equal
deleted
inserted
replaced
| 388:13427f37abab | 389:44ef854da70a |
|---|---|
| 254 :py:meth:`.Configuration.getfirstfloatvarl_s` there exist variants | 254 :py:meth:`.Configuration.getfirstfloatvarl_s` there exist variants |
| 255 that accept a *list* of lists or tuples or dicts that describe | 255 that accept a *list* of lists or tuples or dicts that describe |
| 256 possible variables names and return the first one that is found. | 256 possible variables names and return the first one that is found. |
| 257 | 257 |
| 258 For example -- these methods for retrieving the first found variables | 258 For example -- these methods for retrieving the first found variables |
| 259 can be used and are equivalent:: | 259 can be used and are equivalent (Note that a caller that wants to use |
| 260 variables from a non-default namespace must use a sequence of dicts | |
| 261 here):: | |
| 260 | 262 |
| 261 value1 = config.getfirstvar_s("key1.subkey2", "key3.subkey4", default=None, namespace=None) | 263 value1 = config.getfirstvar_s("key1.subkey2", "key3.subkey4", default=None, namespace=None) |
| 262 value2 = config.getfirstvarl_s(*[["key1", "subkey2"], ["key3", "subkey4"]], default=None) | 264 value2 = config.getfirstvarl_s(*[["key1", "subkey2"], ["key3", "subkey4"]], default=None) |
| 263 value3 = config.getfirstvarl_s(*(("key1", "subkey2"), ("key3", "subkey4")), default=None) | 265 value3 = config.getfirstvarl_s(*(("key1", "subkey2"), ("key3", "subkey4")), default=None) |
| 264 value4 = config.getfirstvarl_s(*[{"namespace": None, "path": ["key1", "subkey2"]}, {"namespace": None, "path": ("key3", "subkey4")}], default=None) | 266 value4 = config.getfirstvarl_s(*[{"namespace": None, "path": ["key1", "subkey2"]}, {"namespace": None, "path": ("key3", "subkey4")}], default=None) |
