configure.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:loopchain 作者: theloopkr 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号