MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / ConfigDict

Class ConfigDict

util/config.py:25–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class ConfigDict(Dict):
26 def __missing__(self, name):
27 raise KeyError(name)
28
29 def __getattr__(self, name):
30 try:
31 value = super(ConfigDict, self).__getattr__(name)
32 except KeyError:
33 ex = AttributeError(f"'{self.__class__.__name__}' object has no "
34 f"attribute '{name}'")
35 except Exception as e:
36 ex = e
37 else:
38 return value
39 raise ex
40
41
42class Config(object):

Callers 4

__init__Method · 0.85
__setattr__Method · 0.85
__setitem__Method · 0.85
merge_from_dictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected