def build_inheritance(current_fnm):
with open(current_fnm) as f:
current_dict = toml.loads(f.read())
if 'inherits' in current_dict.keys():
config_dir = os.path.dirname(current_fnm)
inherits_fnm = os.path.join(config_dir, current_dict['inherits'])
parent_dict = build_inheritance(inherits_fnm)
current_dict = update_recursively(parent_dict, current_dict)
return current_dict
评论列表
文章目录