plugin module

Plugin module.

Contains all classes related to python plugins.

class mrv2.plugin.Plugin

import mrv2 from mrv2 import plugin

class DemoPlugin(plugin.Plugin):
def __init__(self):

“”” Constructor for DemoPlugin.

Define your own variables here. “”” super().__init__()

def run(self):

“”” Example method used for the callback. “”” print(“Hello from Python plugin”)

def active(self):

“”” Optional method to return whether the plug-in is active or not.

return:

True if the plug-in is active, False otherwise.

rtype:

bool

“”” return True

def menus(self):

“”” Dictionary of menu entries as keys with callbacks as values.

return:

A dictionary of menu entries and their corresponding callbacks.

rtype:

dict

“”” menus = {“New Menu/Hello”: self.run} return menus

active(self: mrv2.plugin.Plugin) bool

Whether a plugin is active or not. If not overriden, the default is True.

menus(self: mrv2.plugin.Plugin) dict

Dictionary of menu entries with callbacks, like:

def menus(self):

menus = { “Nem Menu/Hello” : self.run } return menus