Mercurial > hgrepos > Python > libs > ConfigMix
comparison docs/introduction.rst @ 658:6102b767fc69
Basic documentation for the indexed list access
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Mon, 30 May 2022 13:23:53 +0200 |
| parents | 84d4f82ffe59 |
| children | b97e5f3bbc8e |
comparison
equal
deleted
inserted
replaced
| 657:213f0ec3bbbc | 658:6102b767fc69 |
|---|---|
| 287 :py:meth:`~.Configuration.getvar_s` to retrieve variables. | 287 :py:meth:`~.Configuration.getvar_s` to retrieve variables. |
| 288 | 288 |
| 289 With :py:meth:`~.Configuration.getvarl` or | 289 With :py:meth:`~.Configuration.getvarl` or |
| 290 :py:meth:`~.Configuration.getvarl_s` quoting is neither needed | 290 :py:meth:`~.Configuration.getvarl_s` quoting is neither needed |
| 291 and not supported. | 291 and not supported. |
| 292 | |
| 293 | |
| 294 Direct Access to List Items | |
| 295 --------------------------- | |
| 296 | |
| 297 Direct access to list items is possible: | |
| 298 | |
| 299 - Directly use the integer list index in :py:meth:`~.Configuration.getvarl` | |
| 300 and its friends. | |
| 301 - Encode the index number to string format using the ``~INDEX~`` syntax and | |
| 302 use :py:meth:`~.Configuration.getvar` and its friends. | |
| 303 | |
| 304 Negative indexes are supported with Python semantics. | |
| 305 | |
| 306 Examples: | |
| 307 | |
| 308 - ``config.getvarl_s("mylist", 0)`` or ``config.getvar_s("mylist.~0~)"`` | |
| 309 - ``config.getvarl_s("mylist", -1)`` or ``config.getvar_s("mylist.~-1~")`` | |
| 310 | |
| 311 | |
| 292 | 312 |
| 293 .. _merging-deletions: | 313 .. _merging-deletions: |
| 294 | 314 |
| 295 Deletions | 315 Deletions |
| 296 --------- | 316 --------- |
