mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 00:53:25 +00:00
rebase
This commit is contained in:
@ -36,6 +36,13 @@ class Configuration():
|
||||
if length == 0 or not isinstance(cfg, dict):
|
||||
return None
|
||||
if length == 1:
|
||||
return self.get(path.split("."), cfg, default=default)
|
||||
lenght = len(path)
|
||||
if lenght == 0 or not isinstance(cfg, dict):
|
||||
if default is None:
|
||||
return None
|
||||
return default
|
||||
if lenght == 1:
|
||||
return cfg.get(path[0])
|
||||
return self.get(path[1:], cfg.get(path[0]), default=default)
|
||||
|
||||
@ -87,4 +94,4 @@ class EnvConf():
|
||||
|
||||
@inject
|
||||
def __init__(self, config: Configuration) -> None:
|
||||
self.version = config.get("env.version")
|
||||
self.version = config.get("env.version")
|
||||
Reference in New Issue
Block a user