Esempio n. 1
0
 def __getattr__(self, name, *args, **kwargs):
     try:
         keys = self.normalize_keys(name).split(".")
         aux_dict = self
         for k in keys:
             aux_dict = aux_dict[k]
         return aux_dict
     except KeyError:
         raise AttrDoesNotExistException(
             "Variable {} not exist in the config file".format(name))
Esempio n. 2
0
 def __getattr__(self, name, *args, **kwargs):
     try:
         keys = self.normalize_keys(name).split(".")
         aux_dict = self
         for k in keys:
             aux_dict = aux_dict[k]
         return aux_dict
     except KeyError as e:
         if self._empty_init:
             return ConfFile(config={},
                             empty_init=self._empty_init,
                             crypt=self._crypt_cls)
         raise AttrDoesNotExistException(
             "Variable {} not exist in the config file".format(name)) from e