From 91e4b5f73acebd4906d5b97d8cbffbd42e4f09d3 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Wed, 2 Aug 2023 20:34:16 +0200 Subject: [PATCH] added default path --- dyn_gandi/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dyn_gandi/main.py b/dyn_gandi/main.py index 24ef006..4bb7f76 100644 --- a/dyn_gandi/main.py +++ b/dyn_gandi/main.py @@ -1,10 +1,13 @@ import requests, json, re, os from datetime import datetime -def loadSettings() -> dict: +def loadSettings(path = None) -> dict: + if path is None: + path = f"{os.path.expanduser('~')}/config.json" + # TODO: check integrity try: - with open('config.json', 'r') as file: + with open(path, 'r') as file: # Read if the API keys are path to files config = json.load(file) keys = config['api'].keys()