forked from TonicAI/condenser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_reader.py
More file actions
37 lines (26 loc) · 1.05 KB
/
config_reader.py
File metadata and controls
37 lines (26 loc) · 1.05 KB
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
30
31
32
33
34
35
36
import json
class ConfigReader:
class __ConfigReader:
def __init__(self):
with open('config.json','r') as fp:
self.config = json.load(fp)
def get_passthrough_threshold(self):
return self.config['passthrough_threshold']
def get_passthrough_tables(self):
return list(self.config['passthrough_tables'])
def get_tables(self):
return list(self.config['tables'])
def get_all_tables(self):
return list(self.config['tables'] + self.config['passthrough_tables'])
def get_dependency_breaks(self):
return list(self.config['dependency_breaks'])
def get_desired_result(self):
return dict(self.config['desired_result'])
def get_max_tries(self):
return self.config['max_tries']
instance = None
def __init__(self):
if not ConfigReader.instance:
ConfigReader.instance = ConfigReader.__ConfigReader()
def __getattr__(self, name):
return getattr(self.instance, name)