pluginplayer.plugin_manager
- Dynamically Importing Plugins
Modular packages must be imported into the system when creating a GUI interface to allow users to work with Plugins. Each CMake compiled modular project creates a Plugin file within the internal build directory, registered as a .so file. Each Plugin has the load_modules() function to import Modules into a ModuleManager. If the Plugin contains Modules that don’t define its inputs, outputs, or submodules, the Plugin will not be imported, and an error message will be displayed. The ModuleManager acts as a directory for all the Modules to be later configured and run.
The current GUI design for dynamically importing and viewing plugin information to create an efficient application build.
Users can enter a path to a plugin .so file or a directory to browse.
Once a Plugin is imported using the plugin_loader function, it is displayed as a folder in the Plugin Section, updated by the plugin_view function.
- Viewing Modules and API
A comprehensive GUI application should allow users to view each dynamically imported plugin’s Modules and their APIs, including a functional description, inputs, outputs, and required submodules, to gain information when creating an application design. Having documentation of each loaded Module allows for a more efficient application build.
When selecting a Plugin folder, a user is shown a popup, showing each of the Plugin’s Modules using the view_modules function. The user can also delete the Plugin and remove its Modules from the ModuleManager, clone a Module into the Module Manager, and add a Module to the Module tree for application building, and view its API info.
When selecting the “Info” button for the module, the following popup is displayed to show the Module’s description, inputs, outputs, and submodules using the view_module_info function. Information is provided for the Module’s parameters. If the Module does not provide information, “description unavailable” will be shown.
Attributes
Classes
The module class for storing information for the GUI, regarding the user's inputs and property types they set to each module |
|
Helper class for the PluginPlayer application handling loading/deleting plugins and viewing their modules |
Module Contents
- pluginplayer.plugin_manager.PluginInfo
- class pluginplayer.plugin_manager.ModuleValues(module_name, mm)
The module class for storing information for the GUI, regarding the user’s inputs and property types they set to each module
- inputs
- evaluated_inputs
- property_type = None
- evaluated_property_type = None
- class pluginplayer.plugin_manager.PluginManager(plugin_player)
Helper class for the PluginPlayer application handling loading/deleting plugins and viewing their modules
- saved_plugins = []
- plugin_player
- custom_declaration = None
- plugin_loader()
Attempt to load in a plugin from a filepath stored in an entry box and update the plugin view and module manager
- delete_plugin(instance)
delete a preinstalled plugin from the module manager, remove all it’s module nodes, remove linkage from the tree that depend on it’s modules, and remove the folder from the plugin view.
- view_module_info(instance)
View a module’s information of its property types, submodules, inputs, outputs, and description
- Parameters:
instance (kivy.uix.button.Button) – Button that calls this function
- duplicate_module(instance)
Duplicates a module into the Module Manager by asking for a new name through a popup
- Parameters:
instance (kivy.uix.button) – The Clone button calling this function
- initiate_clone(instance)
Internal function of duplicate_module that initiates the cloning process and stores in the saved plugins
- Parameters:
instance (kivy.uix.button) – When the submit button for the clone popup is pressed
- view_modules(instance)
View modules from selecting a plugin giving options to add to the tree and view information
- Parameters:
instance (kivy.uix.button.Button) – Button that calls this function
- plugin_view(dropped, widget)
Updates the plugin section listing the import plugins, and will add a dropdown for the listed plugin, adding the given dropdown widget
- Parameters:
dropped (int) – the plugin number which needs a dropdown
widget (kivy.uix.boxlayout) – the dropdown widget to be placed after the dropped plugin