paws.core.plugins package

Submodules

paws.core.plugins.CitrinationPlugin module

paws.core.plugins.PawsPlugin module

class paws.core.plugins.PawsPlugin.PawsPlugin(inputs)[source]

Bases: object

Base class for building PAWS Plugins.

content()[source]

Return a dict containing meaningful plugin content.

This method is used to fetch Plugin content. It should be reimplemented for most practical PawsPlugin subclasses.

description()[source]

Describe the plugin.

PawsPlugin.description() returns a string documenting the functionality of the PawsPlugin, the current input settings, etc. Reimplement this in PawsPlugin subclasses.

keys()[source]
setup_dict()[source]

Return a dict that states the plugin’s module and inputs.

start()[source]

Start the plugin.

Assuming a plugin’s inputs have been set, PawsPlugin.start() should prepare the plugin for use, e.g. by opening connections, reading files, etc. Reimplement this in PawsPlugin subclasses as needed.

stop()[source]

Stop the plugin.

PawsPlugin.stop() should provide a clean end for the plugin, for instance closing connections used by the plugin. Reimplement this in PawsPlugin subclasses as needed.

paws.core.plugins.PluginManager module

class paws.core.plugins.PluginManager.PluginManager[source]

Bases: paws.core.models.TreeModel.TreeModel

Tree for storing, browsing, and managing PawsPlugins

add_plugin(plugin_name, plugin_module)[source]

Import, name, and add a plugin.

After a plugin is added to a plugin_manager, it is available as plugin_manager.plugins[plugin_name].

Parameters:
  • plugin_name (str) – Name that will be used to refer to this plugin after it is added.
  • plugin_module (str) – Name of the plugin module. Example: If class MyPlugin is in the CATEGORY.MyPlugin module, retrieve it with plugin_module = ‘CATEGORY.MyPlugin’.
build_tree(x)[source]

Return a dict describing a tree-like structure of this object.

This is a reimplemention of TreeModel.build_tree() to define this object’s child tree structure. For a PluginManager, a dict is provided for each PawsPlugin, where the dict contains the results of calling self.build_tree(plugin.inputs) and self.build_tree(plugin.content()).

get_plugin(plugin_module)[source]

Import, instantiate, return a PawsPlugin from its module.

This can also be used to test the Python environment for compatibility with a plugin.

Parameters:plugin_module (str) – Name of the plugin module. See add_plugin().
Returns:An instance of the PawsPlugin subclass defined in plugin_module.
Return type:PawsPlugin
load_plugin(plugin_name, plugin_setup_dict)[source]

Load, set up, and start() a PawsPlugin, given its setup_dict().

Parameters:
  • plugin_name (str) – Name that will be used to refer to this plugin after it is added.
  • plugin_setup_dict (dict) – Dict specifying plugin setup, probably generated by calling the plugin’s own setup_dict() method.
n_plugins()[source]

Return number of plugins currently loaded.

set_input(plugin_name, input_name, val=None)[source]

Set a plugin input to the provided value.

Parameters:
  • plugin_name (str) – Name that will be used to refer to this plugin after it is added.
  • input_name (str) – name of the input to be set
  • val (object) – the data to be used as plugin input
start_plugin(plugin_name)[source]
stop_plugin(plugin_name)[source]

paws.core.plugins.SpecClientPlugin module

paws.core.plugins.TCPClientPlugin module

Module contents

paws.core.plugins.load_plugins(pkg_path)[source]