Plugin Manager Library Functions The Plugin manager loads and manages one or more plugins.
More...
Plugin Manager Library Functions The Plugin manager loads and manages one or more plugins.
Handles to individual plugins are obtained by the getFirstPlugin, getNextPlugin etc functions, or the getPlugin(pluginName) function.
The basic approach to using the plugin system is:
- Create a plugin manager first
- Load the plugins using loadPlugins (all) or loadPlugin (specific one)
- Obtain the plugin handle using getPlugin or directly from loadPlugin (singular)
- Using the plugin handle, set values to the plugin properties
- Run the plugin method execute(pluginHandle)
- Retrieve results from plugin properties
def python.telplugins_c_api.createPluginManager |
( |
|
pluginDir = None ) | |
|
Create a new instance of a plugin manager.
A PluginManager manages a collection of plugins, loaded and unloaded by the load and unload API functions respectively.
- Parameters
-
pluginDir | Full path to folder containing plugins. If None, uses default folder. |
- Returns
- On success, a handle to a Plugin manager, on failure, None.
1 pm = telPlugins.createPluginManager()
def python.telplugins_c_api.freePluginManager |
( |
|
pm) | |
|
Free the plugin manager.
A call to this function will also unload any loaded plugins.
- Parameters
-
pm | Handle to a plugin manager. |
- Returns
- true if success, false otherwise.
def python.telplugins_c_api.getCurrentPlugin |
( |
|
pm) | |
|
getCurrentPlugin retrieves the "current" plugin in the plugin managers internal list of plugins.
This function is typically used together with the getFirst, Next and getPreviousPlugin functions.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns a handle to a plugin. Returns None if the plugin is not found
def python.telplugins_c_api.getFirstPlugin |
( |
|
pm) | |
|
getFirstPlugin retrieves the "first" plugin in the plugin managers internal list of plugins.
This function is typically used together with the getNextPlugin and the getPreviousPlugin functions.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns a handle to a plugin. Returns None if the plugin is not found
def python.telplugins_c_api.getNextPlugin |
( |
|
pm) | |
|
getNextPlugin retrieves the "next" plugin in the plugin managers internal list of plugins.
This function is typically used together with the getFirstPlugin and getPreviousPlugin functions.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns a handle to a plugin. Returns None if the plugin is not found
def python.telplugins_c_api.getNumberOfPlugins |
( |
|
pm) | |
|
Get number of loaded plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns the number of loaded plugins, -1 if a problem is encountered. Call telPlugins.getLastError() to obtain error message.
def python.telplugins_c_api.getPlugin |
( |
|
pm, |
|
|
|
pluginName |
|
) |
| |
Get the plugin handle for the named plugin.
- Parameters
-
pm | Handle to a PluginManager instance |
pluginName | A string that holds the name of the plugin |
- Returns
- Returns a handle to a plugin, with name as supplied in the property pluginName. Returns None if the plugin is not found
def python.telplugins_c_api.getPluginLibraryNames |
( |
|
pm) | |
|
Function to retrieve the library names of all currently loaded plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns library names for all loaded plugins as a string, None otherwise
1 names = telPlugins.getPluginLibraryNames(pm)
3 [
'tel_add_noise',
'tel_lm']
def python.telplugins_c_api.getPluginLoadErrors |
( |
|
pm) | |
|
Get any Errors catched during loading of plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns a string if there was errors, None otherwise
def python.telplugins_c_api.getPluginNames |
( |
|
pm) | |
|
Function to retrieve the names of all currently loaded plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns names for all loaded plugins as a string, None otherwise
1 names = telPlugins.getPluginNames(pm)
3 [
'AddNoise',
'Levenberg-Marquardt']
def python.telplugins_c_api.getPreviousPlugin |
( |
|
pm) | |
|
getPreviousPlugin retrieves the "previous" plugin in the plugin managers internal list of plugins.
This function is typically used together with the getFirstPlugin and getNextPlugin functions.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns a handle to a plugin. Returns None if the plugin is not found
def python.telplugins_c_api.hasLoadPluginErrors |
( |
|
pm) | |
|
Check if there was any Errors catched during loading of plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns true or false indicating if there was errors
def python.telplugins_c_api.loadPlugin |
( |
|
pm, |
|
|
|
pluginName |
|
) |
| |
Load a particular plugin.
- Parameters
-
pm | Handle to a PluginManager instance |
pluginName | Name of the plugin to load. The plugin name is the plugin's shared library name, without path and extension. The library names for the plugins can be obtained by calling getPluginNames() |
- Returns
- Returns a handle to a plugin, None if unsuccesful
1 lmPlugin = telPlugins.loadPlugin(pm,
"tel_lm")
def python.telplugins_c_api.loadPlugins |
( |
|
pm) | |
|
Load plugins.
The function will look in the default plugin folder for plugins, and load them.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns true if Plugins are loaded, false otherwise
1 sucess = telPlugins.loadPlugins (pm)
def python.telplugins_c_api.unLoadPlugin |
( |
|
pm, |
|
|
|
pHandle |
|
) |
| |
Unload a particular plugin.
- Parameters
-
pm | Handle to a PluginManager instance |
pHandle | Handle to a Plugin instance |
- Returns
- Returns true if the Plugin are unloaded succesfully, false otherwise
def python.telplugins_c_api.unLoadPlugins |
( |
|
pm) | |
|
Unload all plugins.
- Parameters
-
pm | Handle to a PluginManager instance |
- Returns
- Returns true if Plugins are unloaded succesfully, false otherwise