From c4623f8808f63d72e6ae8ab2063af3c9ace10e9b Mon Sep 17 00:00:00 2001 From: xelast418 Date: Thu, 21 Sep 2023 09:49:07 +1200 Subject: [PATCH] Replaces True with yes for specifying additional conf to avoid JSON/Python conflict ``` --- README.md | 6 +++--- app/tools/tools.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f681268..609c0cb 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The JSON configuration file should look like the following. ```json [ { - "conf": true, + "conf": "str", "extends": "str", "extendFail": "str", }, @@ -110,7 +110,7 @@ Only the `url` and the `name` field are mandatory. - `redactAs`: Replaces the content of the field with the specified string If multiple calendars are specified in the configuration list, their events will be merged in the resulting ics feed. -The first dataset with {"conf": true,} specifies options that are globally applied to all calenders in the conf. Omit this set to disable. Options +The first dataset with {"conf": "yes",} specifies options that are globally applied to all calenders in the conf. Omit this set to disable. Options - `extends`: string specifying the name (excluding .json) of another config file to extend. - `extendFail`: string speciying the action to take if an extend fails, either "fail" or "ignore". Default is "fail". @@ -118,7 +118,7 @@ The first dataset with {"conf": true,} specifies options that are globally appli Once the config file is created, the corresponding HTTP endpoint is accessible. For example, if the file `app/config/my-calendar.json` contains the configuration, the HTTP endpoint will be `http://localhost:8088/my-calendar`. A config can extend another config file, to do this the extended config should contain begin with`{ - "conf": true, + "conf": "yes", "extends": , "extendFail": "fail", },` diff --git a/app/tools/tools.py b/app/tools/tools.py index ca5ec91..06aadac 100644 --- a/app/tools/tools.py +++ b/app/tools/tools.py @@ -348,7 +348,7 @@ def process(path: str, from_cache: bool = True) -> Calendar: data = [] for entry in config: - if entry.get("conf", False) == True: + if entry.get("conf", "no") == "yes": if entry.get("extends", None) is not None: try: o = "app/config/" + sanitize_filename(entry["extends"]) + ".json"