profile_manager.handlers.plugins module

profile_manager.handlers.plugins.collect_plugin_names(profile_path: Path) → list[str][source]

Returns the directory names of installed plugins in the profile directory.

profile_manager.handlers.plugins.import_plugins(source_profile_path: Path, target_profile_path: Path, target_qgis_ini_file: Path, plugin_names: list[str])[source]

Copies the specified plugins from source to target profile.

Copies the files and sets the INI options accordingly. Imported plugins are always set to be active.

Note: If a target plugin directory exists, it will be deleted/overwritten.

Note: Plugin specific settings are not copied as we have no way of knowing where or how they are stored.

Plugins are stored in python/plugins/ Their active state is tracked in QGIS/QGIS3.ini’s [PythonPlugins] section with an entry using the same name as the plugin’s directory, e.g.:

...
[PythonPlugins]
...
fooPlugin=true
PluggyBar=true
BaZ=false
...
Parameters:
  • source_profile_path – Path of profile directory to import from

  • target_profile_path – Path of profile directory to import to

  • target_qgis_ini_file – Path of target QGIS3.ini file to import to

  • plugin_names – List of plugins (=their directory names) to import

profile_manager.handlers.plugins.remove_plugins(profile_path: Path, qgis_ini_file: Path, plugin_names: list[str])[source]

Removes the specified plugins from the profile.

Removes both the files from python/plugins/ and the QGIS/QGIS3.ini [PythonPlugins] section entries.

Note: Plugin-specific settings are not removed as we have no way of knowing where or how they are stored.

Parameters:
  • profile_path – Path of profile directory to remove from

  • qgis_ini_file – Path of target QGIS3.ini file to remove from

  • plugin_names – List of plugins (=their directory names) to remove