OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
PythonPluginSystemManagerImplementationFactory Class Reference

A Factory to manage openassetio.pluginSystem.PythonPluginSystemManagerPlugin derived plugins. More...

Inheritance diagram for PythonPluginSystemManagerImplementationFactory:

Public Member Functions

def __init__ (self, logger, paths=None, disableEntryPointsPlugins=None)
 Creates a new factory. More...
 
def identifiers (self)
 
def instantiate (self, identifier)
 Creates an instance of the openassetio::v1::managerApi::ManagerInterface"ManagerInterface" with the specified identifier. More...
 

Static Public Attributes

string kPluginEnvVar = "OPENASSETIO_PLUGIN_PATH"
 The Environment Variable to read the plug-in search path from. More...
 
string kDisableEntryPointsEnvVar = "OPENASSETIO_DISABLE_ENTRYPOINTS_PLUGINS"
 The Environment Variable to control the discovery of entry point based plugins. More...
 
string kPackageEntryPointGroup = "openassetio.manager_plugin"
 The name of the ManagerPlugin entry point for entry point discovered plugins. More...
 

Detailed Description

A Factory to manage openassetio.pluginSystem.PythonPluginSystemManagerPlugin derived plugins.

Not usually used directly by a host, which instead uses the ManagerFactory.

The factory loads plugins from entry points registered within the openassetio.manager_plugin entry point group, as well as additional plugins found under paths specified in the OPENASSETIO_PLUGIN_PATH env var.

Environment Variables:
OPENASSETIO_PLUGIN_PATH str A PATH-style list of directories to search for PythonPluginSystemManagerPlugin based plugins. It uses the platform-native delimiter. Searched left to right. Plugins found here will take precedence over those discovered through package entry points. Note: this search path is entirely independent of PYTHONPATH and doesn't need to be a subset of those paths. This allows OpenAssetIO plugins to be managed entirely independent of the python runtime if desired, and masked from import statements. Note that this environment variable is also used by the CppPluginSystemManagerImplementationFactory.
Environment Variables:
OPENASSETIO_DISABLE_ENTRYPOINTS_PLUGINS when set, disables entry point based plugin discovery. This can be useful if it is not in use, to avoid unnecessary filesystem access during library initialization. OPENASSETIO_PLUGIN_PATH plugins take precedence over any entry point based ones.

Constructor & Destructor Documentation

def __init__ (   self,
  logger,
  paths = None,
  disableEntryPointsPlugins = None 
)

Creates a new factory.

The factory scans for plugins lazily on the first invocation of identifiers or instantiate.

Parameters
loggerLoggerInterface implementation that will be used to output information about plugin loading.
pathsstr Paths to search for plugins. Defaults to the value of the kPluginEnvVar environment variable.
disableEntryPointsPluginsbool Controls whether package entry point based plugin discovery is allowed. Defaults to False unless the kDisableEntryPointsEnvVar environment variable is set.

Member Function Documentation

def identifiers (   self)
Returns
list, all identifiers known to the factory.
See also
PythonPluginSystemManagerPlugin
def instantiate (   self,
  identifier 
)

Creates an instance of the openassetio::v1::managerApi::ManagerInterface"ManagerInterface" with the specified identifier.

Parameters
identifierstr The identifier of the ManagerInterface to instantiate.
Returns
openassetio.managerApi.ManagerInterface
Exceptions
InputValidationExceptionif the requested identifier has not been registered.
RuntimeErrorif the requested plugin is valid but has no interface method.

Member Data Documentation

string kDisableEntryPointsEnvVar = "OPENASSETIO_DISABLE_ENTRYPOINTS_PLUGINS"
static

The Environment Variable to control the discovery of entry point based plugins.

string kPackageEntryPointGroup = "openassetio.manager_plugin"
static

The name of the ManagerPlugin entry point for entry point discovered plugins.

string kPluginEnvVar = "OPENASSETIO_PLUGIN_PATH"
static

The Environment Variable to read the plug-in search path from.


The documentation for this class was generated from the following file:
  • /src/src/openassetio-python/package/openassetio/pluginSystem/PythonPluginSystemManagerImplementationFactory.py