MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / Config

Class Config

src/config.py:5–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5class Config(dict):
6 def __init__(self, config_path):
7 with open(config_path, 'r') as f:
8 self._yaml = f.read()
9 self._dict = yaml.safe_load(self._yaml)
10 self._dict['PATH'] = os.path.dirname(config_path)
11
12 def __getattr__(self, name):
13 if self._dict.get(name) is not None:
14 return self._dict[name]
15 return None
16
17 def print(self):
18 print('Model configurations:')
19 print('---------------------------------')
20 print(self._yaml)
21 print('')
22 print('---------------------------------')
23 print('')
24
25
26def load_config(path):

Callers 1

load_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected