VISR  0.11.8
Versatile Interactive Scene Renderer
visr::pythonsupport Namespace Reference

Classes

class  GilEnsureGuard
 
class  InitialisationGuard
 

Functions

pybind11::object loadModule (std::string const &moduleName, std::vector< std::string > const &modulePath, pybind11::object &globals)
 
pybind11::object loadModule (std::string const &moduleName, std::vector< std::string > const &modulePath, std::vector< std::string > const &additionalSystemPath, pybind11::object &globals)
 
pybind11::object loadModule (std::string const &moduleName, std::string const &modulePathList, pybind11::object &globals)
 
pybind11::object loadModule (std::string const &moduleName, std::string const &modulePathList, std::string const &additionalPathList, pybind11::object &globals)
 

Function Documentation

pybind11::object visr::pythonsupport::loadModule ( std::string const &  moduleName,
std::vector< std::string > const &  modulePath,
pybind11::object &  globals 
)

Internal function to load a Python module.

Parameters
moduleNameThe name of the module, as it would be used in a Python 'import' statement, i.e., without path or extension.
modulePathOptional search path for the location of the module. If left empty, the default Python system path (including the value of $PYTHONPATH) is searched. The paths are also appended to the system path, for example to locate dependencies of the module moduleName.
globalsAny variables or definitions to be passed to the Python interpreter.
Returns
A Python module object.
pybind11::object visr::pythonsupport::loadModule ( std::string const &  moduleName,
std::vector< std::string > const &  modulePath,
std::vector< std::string > const &  additionalSystemPath,
pybind11::object &  globals 
)

Internal function to load a Python module, overloaded to accept a separate system search path.

Parameters
moduleNameThe name of the module, as it would be used in a Python 'import' statement. I.e., without path or extension
modulePathOptional search path for the location of the module. If left empty, the Python system path (including the value of $PYTHONPATH and the content of the additionalSystemPath variable) is searched.
additionalSystemPathDirectories to be appended to the system directory. This can be used to locate dependencies of the module moduleName, or, if modulePath is empty, moduleName itself.
globalsAny variables or definitions to be passed to the Python interpreter.
Returns
A Python module object.
pybind11::object visr::pythonsupport::loadModule ( std::string const &  moduleName,
std::string const &  modulePathList,
pybind11::object &  globals 
)

Internal function to load a Python module.

Parameters
moduleNameThe name of the module, as it would be used in a Python 'import' statement. I.e., without path or extension
modulePathListOptional search path for the location of the Python path as a comma-separated list. In any case, the Python sys.path is searched, which includes the value of $PYTHONPATH. otherwise the value of modulePath is appended to sys.path, for example to locate dependencies of modulePath.
globalsAny variables or definitions to be passed to the Python interpreter.
Returns
A Python module object.
Exceptions
std::runtime_errorIf the Python module load function fails.
std::invalid_argumentif an entry of the search paths does not exist.
pybind11::object visr::pythonsupport::loadModule ( std::string const &  moduleName,
std::string const &  modulePathList,
std::string const &  additionalPathList,
pybind11::object &  globals 
)