def get_conf(conf_file_path):
"""read toml conf file for latter use.
:param conf_file_path: absolute path of conf file.
:return:a dict contains configured infomation.
"""
if version_info[0] == 3:
with open(conf_file_path, encoding='utf-8') as conf_file:
config = toml.loads(conf_file.read())
else:
with open(conf_file_path) as conf_file:
config = toml.loads(conf_file.read())
return config
评论列表
文章目录