added default path
This commit is contained in:
parent
28e7a2855e
commit
91e4b5f73a
@ -1,10 +1,13 @@
|
|||||||
import requests, json, re, os
|
import requests, json, re, os
|
||||||
from datetime import datetime
|
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
|
# TODO: check integrity
|
||||||
try:
|
try:
|
||||||
with open('config.json', 'r') as file:
|
with open(path, 'r') as file:
|
||||||
# Read if the API keys are path to files
|
# Read if the API keys are path to files
|
||||||
config = json.load(file)
|
config = json.load(file)
|
||||||
keys = config['api'].keys()
|
keys = config['api'].keys()
|
||||||
|
Loading…
Reference in New Issue
Block a user