diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-19 14:40:13 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-19 14:40:13 -0600 |
| commit | 9c8c6c1fc2ccf31bc8c709ab052c34a45e207b36 (patch) | |
| tree | 54dcc521d4390880b89166deffbd5709d97b1e44 /README.md | |
| parent | Add section on using your own parser (diff) | |
| download | config-file-9c8c6c1fc2ccf31bc8c709ab052c34a45e207b36.zip | |
Add support for retrieving entire sections with get()
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -46,19 +46,19 @@ config.stringify() >>> '[calendar]\ntoday = monday\nstart_week_on_sunday = false\ntoday_index = 0\nquarter_hours_passed = 0.25\n\n' ``` -### Retrieve values +### Retrieve values or sections A section.key format is used for retrieving and setting values. ```python -config.get("calendar.today") ->>> 'monday' - # Values from the config file are automatically parsed config.get("calendar.start_week_on_sunday") >>> False # Unless you don't want them to be parsed -config.get("calendar.today_index", parse_type=False) ->>> '0' +config.get("calendar.start_week_on_sunday", parse_type=False) +>>> 'false' + +config.get("calendar") +>>> {'today': 'monday', 'start_week_on_sunday': False, 'today_index': 0, 'quarter_hours_passed': 0.25} ``` ### Set values |