--- /dev/null
+class ConfigManager:
+ """Manager that cares about config files for everything
+ """
+
+ def __init__(self, config_path):
+ """
+ """
+
+ def load(self, config_path=None):
+ """
+ """
+
+ # Parse config file
+ user_config = load(DEFAULT_OPTIONS["config"]["path"]
+ if config_path is None else config_path)
+
+ runtime_config = merge_dicts(DEFAULT_OPTIONS, user_config.get("options", {}))
+
+ if "target_dir" not in runtime_config:
+ debug("Target dir not specified in user config!")
+ debug("Creating tempdir...")
+ runtime_config["target_dir"] = mkdtemp()
+ debug(f"Using {runtime_config['target_dir']}")
+
+ logger_config = merge_dicts(DEFAULT_LOGGER_CONFIG, user_config.get("logger", {}))
+ dictConfig(logger_config)
+
+ debug("Loaded the following user config:")
+ debug(user_config)
+
+ debug("Expanded the default runtime option")
+ debug(DEFAULT_OPTIONS)
+ debug(runtime_config)
+
+ debug("Expanded the default logger options")
+ debug(DEFAULT_LOGGER_CONFIG)
+ debug(logger_config)
+
+ modules = load_plugins(user_config.get("modules", []))
+ corpora = load_corpora(user_config.get("corpora", []))
+ recipes = load_recipes(user_config.get("recipes", []), corpora, modules, runtime_config)
+
+ info("--------------------")
+ info("Finished loading up!")
+
+ if runtime_config.get("mode") == "batch":
+ for _, recipe in recipes.items():
+ recipe.run_steps()
+ else:
+ Fire({"corpus":corpora, "plugin":modules, "recipe":recipes})