Plugin Manager
- class hal_py.plugin_manager.PluginFeature
A feature provided by a plugin, such as a parser or a writer.
- property args
Additional arguments of the feature, holding the supported file extensions if a parser or writer is registered.
- property feature
The kind of feature that is provided.
- Type
hal_py.FacExtensionInterface.Feature
- hal_py.plugin_manager.add_existing_options_description(existing_options: hal_py.ProgramOptions) None
Register existing program options to avoid reuse by plugins.
- Parameters
existing_options (hal_py.ProgramOptions) – The program options.
- hal_py.plugin_manager.add_model_changed_callback(callback: Callable[[bool, str, str], None]) int
Add a callback to notify the GUI about loaded or unloaded plugins. The callback takes a bool that is
Trueon load andFalseon unload, the plugin name, and the plugin path.
- hal_py.plugin_manager.get_cli_plugin_flags() Dict[str, str]
Get a mapping of flags pointing to their corresponding CLI plugin.
- hal_py.plugin_manager.get_cli_plugin_options() hal_py.ProgramOptions
Get the command line interface options of all plugins.
- Returns
The program options.
- Return type
hal_py.ProgramOptions
- hal_py.plugin_manager.get_plugin_features(name: str) List[hal_py.plugin_manager.PluginFeature]
Get the features of a plugin identified by the stem of its file name.
- Parameters
name (str) – The stem of the file name of the plugin.
- Returns
A list of features such as parsers or writers.
- Return type
- hal_py.plugin_manager.get_plugin_instance(plugin_name: str, initialize: bool = True, silent: bool = False) hal::BasePluginInterface
Gets the interface for a plugin specified by name. By default calls the initialize() function of the plugin. The returned object is of the plugin’s own type as soon as the Python module of that plugin has been imported, and of type
hal_py.BasePluginInterfaceotherwise.- Parameters
- Returns
The plugin interface on success,
Noneotherwise.- Return type
- hal_py.plugin_manager.get_plugin_path(plugin_name: str) os.PathLike
Get the full path of a plugin. On macOS, several possible file extensions are probed.
- Parameters
plugin_name (str) – The name of the plugin.
- Returns
The full path to the plugin within the HAL build directory.
- Return type
- hal_py.plugin_manager.get_ui_plugin_flags() Dict[str, str]
Get a mapping of flags pointing to their corresponding UI plugin.
- hal_py.plugin_manager.has_valid_file_extension(file_name: os.PathLike) bool
Check whether a file has an extension that is legal for a plugin on the current operating system.
- Parameters
file_name (pathlib.Path) – The path to the file.
- Returns
Falseif the extension indicates that the file cannot be a plugin,Trueotherwise.- Return type
- hal_py.plugin_manager.load(plugin_name: str, file_path: os.PathLike) bool
Load a single plugin by specifying its name and file path.
- Parameters
plugin_name (str) – The desired name that is unique in the framework.
file_path (pathlib.Path) – The path to the plugin file.
- Returns
Trueon success,Falseotherwise.- Return type
- hal_py.plugin_manager.load_all_plugins(directory_names: List[os.PathLike] = []) bool
Load all plugins in the specified directories. If
directory_namesis empty, the default directories will be searched.- Parameters
directory_names (list[pathlib.Path]) – A list of directory paths.
- Returns
Trueon success,Falseotherwise.- Return type
- hal_py.plugin_manager.remove_model_changed_callback(id: int) None
Remove a registered callback.
- Parameters
id (int) – The ID of the registered callback.