check_config.py 文件源码

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

项目:LambdaMLM 作者: ilg 项目源码 文件源码
def check_config(use_config=None):
    if use_config:
        with lcd(codedir):
            local('cp config.{}.py config.py'.format(use_config))
    try:
        config = imp.load_source('config', os.path.join(codedir, 'config.py'))
    except IOError:
        error('config.py not found.  Did you create it by copying config.example.py?')
    try:
        config_example = imp.load_source('config_example', os.path.join(codedir, 'config.example.py'))
    except IOError:
        error('config.example.py not found.  Did you remove it?')
    if config.signing_key == config_example.signing_key:
        error('You need to change the signing key to your own unique text.')
    if config.s3_bucket == config_example.s3_bucket:
        error('You need to change the s3 bucket name to a bucket you control.')
    puts('Your config.py appears to be set up.')
    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号