Ejemplo n.º 1
0
    def load_plugin_config(self):
        entry_point = self.entry_point
        name = self.name
        key = '.'.join((entry_point, name))

        if self._config.plugins.config_root.startswith('~'):
            plugin_conf_dir = os.path.expanduser(
                self._config.plugins.config_root)

        elif self._config.plugins.config_root.startswith('/'):
            plugin_conf_dir = self._config.plugins.config_root

        else:
            plugin_conf_dir = os.path.join(self._config.config_root,
                                           self._config.plugins.config_root)

        plugin_conf_files = (os.path.join(plugin_conf_dir, '.'.join(
            (key, 'yml'))), )

        self._config.plugins[key] = PluginConfig.from_defaults(
            entry_point, name)
        self._config.plugins[key] = PluginConfig.dict_merge(
            self._config.plugins[key],
            PluginConfig.from_files(plugin_conf_files))
        # allow plugins to be disabled by configuration. Especially important in cases where command line args conflict
        self.enabled = self._config.plugins[key].get('enabled', True)
Ejemplo n.º 2
0
    def load_plugin_config(self):
        entry_point = self.entry_point
        name = self.name
        key = ".".join((entry_point, name))

        plugin_conf_dir = os.path.join(self._config.config_root, self._config.plugins.config_root)
        plugin_conf_files = (os.path.join(plugin_conf_dir, ".".join((key, "yml"))),)

        self._config.plugins[key] = PluginConfig.from_defaults(entry_point, name)
        self._config.dict_merge(self._config.plugins[key], PluginConfig.from_files(plugin_conf_files))
        # allow plugins to be disabled by configuration. Especially important in cases where command line args conflict
        self.enabled = self._config.plugins[key].get("enabled", True)
Ejemplo n.º 3
0
    def load_plugin_config(self):
        entry_point = self.entry_point
        name = self.name
        key = '.'.join((entry_point, name))

        plugin_conf_dir = os.path.join(self._config.config_root,
                                       self._config.plugins.config_root)
        plugin_conf_files = (
            os.path.join(plugin_conf_dir, '.'.join((key, 'yml'))),
        )

        self._config.plugins[key] = PluginConfig.from_defaults(entry_point, name)
        self._config.dict_merge(self._config.plugins[key],
                                PluginConfig.from_files(plugin_conf_files))
Ejemplo n.º 4
0
    def load_plugin_config(self):
        entry_point = self.entry_point
        name = self.name
        key = self.full_name

        if self._config.plugins.config_root.startswith('~'):
            plugin_conf_dir = os.path.expanduser(self._config.plugins.config_root)

        elif self._config.plugins.config_root.startswith('/'):
            plugin_conf_dir = self._config.plugins.config_root

        else:
            plugin_conf_dir = os.path.join(self._config.config_root, self._config.plugins.config_root)

        plugin_conf_files = (
            os.path.join(plugin_conf_dir, '.'.join((key, 'yml'))),
        )

        self._config.plugins[key] = PluginConfig.from_defaults(entry_point, name)
        self._config.plugins[key] = PluginConfig.dict_merge(self._config.plugins[key], PluginConfig.from_files(plugin_conf_files))
        # allow plugins to be disabled by configuration. Especially important in cases where command line args conflict
        self.enabled = self._config.plugins[key].get('enabled', True)