Plugins

Todo

Add info about plugins, their usage and adding custom plugins.

Included plugins

QtPyVCP Plugins

These package level functions provide methods for registering and initializing plugins, as well as retrieving them for use and terminating them in the proper order.

qtpyvcp.plugins.registerPlugin(plugin_id, plugin_inst)[source]

Register a Plugin instance.

Parameters:
  • plugin_id (str) – The unique name to register the plugin under.
  • plugin_inst (plugin_inst) – The plugin instance to register.
qtpyvcp.plugins.registerPluginFromClass(plugin_id, plugin_cls, args=[], kwargs={})[source]

Register a plugin from a class.

This is primarily used for registering plugins defined in the YAML config.

data_plugins:
  my_plugin:
    provider: my_package.my_module:MyPluginClass
    args:
      - 10
      - False
    kwargs:
      my_number: 75
      my_string: A string argument
Parameters:
  • plugin_id (str) – A unique name to register the plugin under.
  • plugin_cls (class, str) – A Plugin subclass, or a fully qualified class spec of format package.module:Class specifying the location of an importable Plugin subclass.
  • args (list) – Arguments to pass to the plugin’s __init__ method.
  • kwargs (dict) – Keyword argument to pass to the plugin’s __init__ method.
Returns:

The plugin instance

qtpyvcp.plugins.getPlugin(plugin_id)[source]

Get plugin instance from ID.

Parameters:plugin_id (str) – The ID of the plugin to retrieve.
Returns:A plugin instance, or None.
qtpyvcp.plugins.initialisePlugins()[source]

Initializes all registered plugins.

Plugins are initialized in the order they were registered in. Plugins defined in the YAML file are registered in the order they were defined.

qtpyvcp.plugins.postGuiInitialisePlugins(main_window)[source]

Initializes all registered plugins after main window is shown.

Plugins are initialized in the order they were registered in. Plugins defined in the YAML file are registered in the order they were defined.

qtpyvcp.plugins.terminatePlugins()[source]

Terminates all registered plugins.

Plugins are terminated in the reverse order they were registered in. If an error is encountered while terminating a plugin it will be ignored and the remaining plugins will still be terminated.