Made read_config robuster against CWD
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
def read_config():
|
||||
with open('nao_defaults.json') as f:
|
||||
HERE = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def read_config(cfg_file=os.path.join(HERE, 'nao_defaults.json')):
|
||||
with open(cfg_file) as f:
|
||||
cfg = json.load(f)
|
||||
return cfg
|
||||
|
||||
Reference in New Issue
Block a user