calibrate.py 文件源码

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

项目:netsocadmin2 作者: UCCNetworkingSociety 项目源码 文件源码
def calibrate():
    print("Configuring Wordpress installer")

    log_location = os.path.dirname(__file__) + '/resources/wordpress_installer.log'
    try:
        os.remove(log_location)
    except Exception as e:
        pass

    env = Environment(loader=PackageLoader('wordpress_installer', '/resources/templates'))
    log_config_template = env.get_template('logging_config.ini.j2') 
    log_config = log_config_template.render(LOG_LOCATION=log_location)

    log_config_location = os.path.dirname(__file__) + "/resources/logging_config.ini"

    with open(log_config_location, "w") as fh:
        fh.write(log_config)

    print("Writing Files Complete!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号