def _load_toml_cli_config(filename=None):
if filename is None:
filename = os.path.join(
_get_config_dir(),
'cli.toml')
if not os.path.exists(filename):
LOGGER.info(
"Skipping CLI config loading from non-existent config file: %s",
filename)
return {}
LOGGER.info("Loading CLI information from config: %s", filename)
try:
with open(filename) as fd:
raw_config = fd.read()
except IOError as e:
raise CliConfigurationError(
"Unable to load CLI configuration file: {}".format(str(e)))
return toml.loads(raw_config)
评论列表
文章目录