PluginManager.import_directory

PluginManager.import_directory(path, module_prefix=None, recursive=False)[source]

Import all python source files in a directory.

This function will import all python source files in a directory. For each imported file a module will be returned. The imported modules will have the name “<module_prefix>.<filename>”.

Parameters
  • path (str) – The full path to the directory to import from.

  • module_prefix (str) – A prefix for the name of the modules.

  • recursive (bool) – Whether to import from subdirectories.

Returns

A list of python modules.

Return type

list