config.py 文件源码

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

项目:dactyl 作者: ripple 项目源码 文件源码
def __init__(self, cli_args):
        """Load config from commandline arguments"""
        self.cli_args = cli_args
        self.set_logging()

        # Don't even bother loading the config file if it's just a version query
        if cli_args.version:
            print("Dactyl version %s" % __version__)
            exit(0)

        self.bypass_errors = cli_args.bypass_errors

        # Start with the default config, then overwrite later
        self.config = yaml.load(resource_stream(__name__, "default-config.yml"))
        self.filters = {}
        if cli_args.config:
            self.load_config_from_file(cli_args.config)
        else:
            logger.debug("No config file specified, trying ./dactyl-config.yml")
            self.load_config_from_file(DEFAULT_CONFIG_FILE)
        self.load_filters()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号