poolcontrollermanager
This module is part of the Python Pool library. It defines the class which controls finding, loading/unloading of device pool controller plug-ins.
Classes
ControllerManager
- class ControllerManager(*p, **k)[source]
-
The singleton class responsible for managing controller plug-ins.
- DEFAULT_CONTROLLER_DIRECTORIES = ('poolcontrollers',)
- setControllerPath(controller_path, reload=True)[source]
Registers a new list of controller directories in this manager.
- Parameters:
controller_path (
Sequence
[str
]) – a sequence of absolute paths where this manager should look for controllers
Warning
as a consequence all the controller modules will be reloaded. This means that if any reference to an old controller object was kept it will refer to an old module (which could possibly generate problems of type class A != class A).
- getControllerPath()[source]
Returns the current sequence of absolute paths used to look for controllers.
- getOrCreateControllerLib(lib_name, controller_name=None)[source]
Gets the exiting controller lib or creates a new controller lib file. If name is not None, a controller template code for the given controller name is appended to the end of the file.
- Parameters:
- Return type:
- Returns:
a sequence with three items: full_filename, code, line number line number is 0 if no controller is created or n representing the first line of code for the given controller name.
- setControllerLib(lib_name, code)[source]
Creates a new controller library file with the given name and code. The new module is imported and becomes imediately available.
- createControllerLib(lib_name, path=None)[source]
Creates a new empty controller library (python module)
- reloadController(controller_name, path=None)[source]
Reloads the module corresponding to the given controller name
- Raises:
sardana.pool.poolexception.UnknownController
in case the controller is unknown orImportError
if the reload process is not successfull- Parameters:
- Return type:
- reloadControllers(controller_names, path=None)[source]
Reloads the modules corresponding to the given controller names
- Raises:
sardana.pool.poolexception.UnknownController
in case the controller is unknown orImportError
if the reload process is not successful- Parameters:
- reloadControllerLibs(module_names, path=None, reload=True)[source]
Reloads the given library(=module) names
- Raises:
sardana.pool.poolexception.UnknownController
in case the controller is unknown orImportError
if the reload process is not successful- Parameters:
- reloadControllerLib(module_name, path=None, reload=True)[source]
Reloads the given library(=module) names
- Raises:
sardana.pool.poolexception.UnknownController
in case the controller is unknown orImportError
if the reload process is not successful- Parameters:
- Return type:
- Returns:
the ControllerLib object for the reloaded controller lib