forked from PPPLDeepLearning/plasma-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
14 lines (13 loc) · 622 Bytes
/
conf.py
File metadata and controls
14 lines (13 loc) · 622 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from plasma.conf_parser import parameters
import os
import errno
if os.path.exists(os.path.join(os.path.abspath(os.path.dirname(__file__)), '../examples/conf.yaml')):
conf = parameters(os.path.join(os.path.abspath(os.path.dirname(__file__)), '../examples/conf.yaml'))
elif os.path.exists('./conf.yaml'):
conf = parameters('./conf.yaml')
elif os.path.exists('./examples/conf.yaml'):
conf = parameters('./examples/conf.yaml')
elif os.path.exists('../examples/conf.yaml'):
conf = parameters('../examples/conf.yaml')
else:
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), 'conf.yaml')