Uranium
Application Framework
UM.PluginRegistry.PluginRegistry Class Reference

A central object to dynamically load modules as plugins. More...

Inherits QObject.

Public Member Functions

def __init__ (self, parent=None)
 
def initializeBeforePluginsAreLoaded (self)
 
def initializeAfterPlguinsAreLoaded (self)
 
def addExternalPlugins (self, plugin_list)
 
def addPluginLocation
 
def checkRequiredPlugins
 
def disablePlugin
 
def enablePlugin
 
def getActivePlugins (self)
 
def getAvailablePlugins (self)
 
def getAllMetaData (self, kwargs)
 
def getDisabledPlugins (self)
 
def getExternalPlugins (self)
 
def getInstalledPlugins (self)
 
def getInstance (cls)
 
def getMetaData
 
def getPluginLocations (self)
 
def installPlugin
 
def isActivePlugin (self, plugin_id)
 
def isAvailablePlugin
 
def isInstalledPlugin
 
def isBundledPlugin
 
def loadPlugins
 Load all plugins matching a certain set of metadata. More...
 
def loadPlugin
 
def setApplication (self, app)
 
def uninstallPlugin
 
def getPluginObject
 Get a speficic plugin object given an ID. More...
 
def addSupportedPluginExtension (self, extension, description)
 
def supportedPluginExtensions (self)
 
def isPluginFile
 
def getPluginPath
 Get the path to a plugin. More...
 
def addType
 Add a new plugin type. More...
 
def removeType
 Remove a plugin type. More...
 

Static Public Attributes

int APIVersion = 4
 
 str
 
 result
 
 supportedPluginExtensionsChanged = pyqtSignal()
 
 notify
 

Detailed Description

A central object to dynamically load modules as plugins.

The PluginRegistry class can load modules dynamically and use them as plugins. Each plugin module is expected to be a directory with and __init__ file defining a getMetaData and a register function.

For more details, see the plugins file.

Member Function Documentation

◆ addType()

def UM.PluginRegistry.PluginRegistry.addType (   cls,
  plugin_type 
)

Add a new plugin type.

This function is used to add new plugin types. Plugin types are simple string identifiers that match a certain plugin to a registration function.

The callable register_function is responsible for handling the object. Usually it will add the object to a list of objects in the relevant class. For example, the plugin type 'tool' has Controller::addTool as register function.

register_function will be called every time a plugin of type is loaded.

Parameters
typestring The name of the plugin type to add.
register_functioncallable A callable that takes an object as parameter.

◆ getPluginObject()

def UM.PluginRegistry.PluginRegistry.getPluginObject (   self,
  plugin_id 
)

Get a speficic plugin object given an ID.

If not loaded, load it.

Parameters
plugin_idstring The ID of the plugin object to get.

◆ getPluginPath()

def UM.PluginRegistry.PluginRegistry.getPluginPath (   self,
  plugin_id 
)

Get the path to a plugin.

Parameters
plugin_idstring The ID of the plugin.
Returns
string The absolute path to the plugin or an empty string if the plugin could not be found.

◆ loadPlugins()

def UM.PluginRegistry.PluginRegistry.loadPlugins (   self,
  metadata 
)

Load all plugins matching a certain set of metadata.

Parameters
meta_datadict The meta data that needs to be matched.
See also
loadPlugin NOTE: This is the method which kicks everything off at app launch.

◆ removeType()

def UM.PluginRegistry.PluginRegistry.removeType (   cls,
  plugin_type 
)

Remove a plugin type.

Parameters
typestring The plugin type to remove.

The documentation for this class was generated from the following file: