errbot

Errbot: How can I import one plugin from another


In this case I have a simple JIRA plugin, I'd like to create another plugin that also interacts with JIRA via the first plugin. I have been trying variations of errbot.plugin_manager.get_plugin_obj_by_name('jira') but I haven't found the right way to do this.


Solution

  • You are in luck, it just got implemented in the 4.3.0 version released yesterday:

    Basically you need to declare the dependency in the .plug with DependsOn in the [Core] section then you can get the plugin object you depend on with self.get_plugin('pluginName').

    https://github.com/errbotio/errbot/blob/master/docs/user_guide/plugin_development/dependencies.rst