| 23 | |
| 24 | |
| 25 | class 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 | |
| 42 | class Config(object): |
no outgoing calls
no test coverage detected