File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
from uuid import uuid1
5
5
from jsonschema import validate
6
6
from json import dumps , load
7
- from os .path import basename , join , dirname , realpath
8
- from os import getcwd
7
+ from os .path import basename , join , dirname , abspath
8
+ from pathlib import Path
9
9
10
10
DB_NAME = "gnom_db"
11
11
HELP_STRING = "Example call: python3 importDataset.py PATH/TO/JSON"
12
12
BASE_PATH_TO_IMPORT = "/flask-backend/data/import/"
13
13
14
- __location__ = realpath (join (getcwd (), dirname (__file__ )))
14
+ __location__ = Path (abspath (dirname (__file__ )))
15
+ __project_dir__ = __location__ .parent .absolute ().parent .absolute ()
15
16
16
17
17
18
def loadDataset (datasets_path ):
@@ -44,7 +45,7 @@ def loadDataset(datasets_path):
44
45
print ("Valid inputs..." , flush = True )
45
46
46
47
try :
47
- with open (join (__location__ , "../../ local.config" )) as config_file :
48
+ with open (join (__project_dir__ , "local.config" )) as config_file :
48
49
config_params = config_file .readlines ()
49
50
config_file .close ()
50
51
You can’t perform that action at this time.
0 commit comments