Пример #1
0
    def _load_add_composed_plugin(self, name_first, name_second, plugin_sub):
        if name_first in self._cache_plugins:
            plugin_composed = self._cache_plugins[name_first]
            if not plugin_composed.is_composed():
                plugin_composed = self._load_convert_into_composed(name_first, plugin_composed)
        else:
            # create new PluginComposed
            plugin_composed = plugin.PluginComposed(name_first)
            self._cache_plugins[name_first] = plugin_composed

        allready_exists = not plugin_composed.try_add_command(plugin_sub, name_second)
        if allready_exists:
            error("Duplicated plugin {} {}".format(name_first, name_second))
Пример #2
0
 def _load_convert_into_composed(self, name, plugin_default):
     plugin_composed = plugin.PluginComposed(name)
     plugin_composed.try_set_default(plugin_default)
     self._cache_plugins[name] = plugin_composed
     return plugin_composed
Пример #3
0
 def _load_convert_into_composed(self, name, plugin_fallback):
     plugin_composed = plugin.PluginComposed(name)
     plugin_composed.try_set_fallback(plugin_fallback)
     self._cache_plugins[name] = plugin_composed
     return plugin_composed