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()
评论列表
文章目录