Plugin(name, description, tags=None, has_advanced=False, permissions=None, integrations=None, version=None)¶
Process that connects to NTS, and allows a user to access a PluginInstance.
When plugin process is running, an entry is added to the Nanome Stacks Menu.
When a user activates a Plugin, this class creates a PluginInstance object connected to the user’s Nanome session.
Command Line Interface for Plugins.
Moved into config.py, but there are plugins that retrieve parser from Plugin class. Leaving this here for backwards compatibility.
rtype: argsparser: args parser
Name of plugin as shown in the Nanome Stacks menu.
- Function to call when the plugin is about to exitUseful when using autoreload
- Function to call before the plugin runs and tries to connect to NTSUseful when using autoreload
run(host=None, port=None, key=None)¶
- Starts the plugin by connecting to the server specified.If arguments (-a, -p) are given when starting plugin, host/port will be ignored.Function will return only when plugin exits.
- Store arbitrary data to send to plugin instances
Parameters: args (Anything serializable) – Variable length argument list
- Set plugin class to instantiate when a new session is connectedThe plugin class should interact with or override functions in
PluginInstanceto interact with Nanome
Parameters: plugin_class (
PluginInstance) – Plugin class to instantiate
setup(name, description, tags, has_advanced, plugin_class, host=None, port=None, key=None, permissions=None, integrations=None)¶