added default path
This commit is contained in:
parent
28e7a2855e
commit
91e4b5f73a
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user