def load_configure_json(self, configure_file_path: str) -> None:
"""method for reading and applying json configuration.
:param configure_file_path: json configure file path
:return: None
"""
print(f"try load configure from json file ({configure_file_path})")
try:
with open(f"{configure_file_path}") as json_file:
json_data = json.load(json_file)
for configure_key, configure_value in json_data.items():
try:
configure_type, configure_value = self.__check_value_type(configure_key, configure_value)
self.__set_configure(configure_key, configure_type, configure_value)
except Exception as e:
# no configure value
print(f"this is not configure key({configure_key}): {e}")
except Exception as e:
exit(f"cannot open json file in ({configure_file_path}): {e}")
importlib.reload(loopchain.utils)
评论列表
文章目录