From 5997cd3b512c8efb1e6bec3ca831ba1ac0d89db0 Mon Sep 17 00:00:00 2001 From: Rubaiyat Khondaker Date: Tue, 15 Sep 2020 15:07:31 +0100 Subject: [PATCH] Script now automatically updates config file if there's an error --- obsidian_to_anki.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/obsidian_to_anki.py b/obsidian_to_anki.py index 357d8b99..981ce6ef 100644 --- a/obsidian_to_anki.py +++ b/obsidian_to_anki.py @@ -671,7 +671,13 @@ class App: def __init__(self): """Execute the main functionality of the script.""" - Config.load_config() + try: + Config.load_config() + except configparser.Error as e: + print("Error:", e) + print("Attempting to fix config file...") + Config.update_config() + Config.load_config() if CONFIG_DATA["GUI"]: self.setup_gui_parser() else: