-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
29 lines (22 loc) · 823 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
_CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
class Config(object):
def __init__(self):
self.CURRENT_DIR = _CURRENT_DIR
self.DATA_PATH = os.path.abspath(os.path.join(_CURRENT_DIR, "data"))
self.SAVED_MODEL_PATH = os.path.abspath(
os.path.join(_CURRENT_DIR, "saved_models")
)
if not os.path.isdir(self.SAVED_MODEL_PATH):
os.system("mkdir -p {}".format(self.SAVED_MODEL_PATH))
def display(self):
"""
Display Configuration values.
"""
print("\nConfigurations:")
for a in dir(self):
if not a.startswith("__") and not callable(getattr(self, a)):
print("{:30} {}".format(a, getattr(self, a)))
print("\n")