From 9c8c6c1fc2ccf31bc8c709ab052c34a45e207b36 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 19 Jan 2020 14:40:13 -0600 Subject: Add support for retrieving entire sections with get() --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index bb76e0f..708ad83 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3