__init__.py 文件源码

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

项目:http-observatory 作者: mozilla 项目源码 文件源码
def __conf(section, param, type=None):
    try:
        if type == str or type is None:
            return _config_parser.get(section, param)
        elif type == int:
            return _config_parser.getint(section, param)
        elif type == bool:
            return _config_parser.getboolean(section, param)
        elif type == float:
            return _config_parser.getfloat(section, param)
        else:
            return None
    except (KeyError, configparser.NoSectionError):
        return None
    except:
        print('Error with key {0} in section {1}'.format(param, section))
        sys.exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号