Skip to content

Commit

Permalink
Script now automatically updates config file if there's an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pseudonium committed Sep 15, 2020
1 parent 32fca09 commit 5997cd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion obsidian_to_anki.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5997cd3

Please sign in to comment.