def save(toml_config, config_path=None):
"""
:param toml_config: TOML configuration object
:type toml_config: MutableToml or Toml
:param config_path: path to config to use
:type config_path: str
"""
serial = toml.dumps(toml_config._dictionary)
if config_path is None:
config_path = get_config_path()
util.ensure_file_exists(config_path)
util.enforce_file_permissions(config_path)
with util.open_file(config_path, 'w') as config_file:
config_file.write(serial)
评论列表
文章目录