config.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号