laborchestrator.pythonlab_process_finder module

This module provides the ProcessFinder. A tool ta get a list of all available PythonLan processes in a specified directory or module.

class laborchestrator.pythonlab_process_finder.ImportableProcess(module, name)[source]

Bases: NamedTuple

_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('module', 'name')
classmethod _make(iterable)

Make a new ImportableProcess object from a sequence or iterable

_replace(**kwds)

Return a new ImportableProcess object replacing specified fields with new values

module: ModuleType

Alias for field number 0

name: str

Alias for field number 1

class laborchestrator.pythonlab_process_finder.ProcessFinder[source]

Bases: object

static _can_be_constructed_without_args(process_type: type[PLProcess]) bool[source]
static _find_processes(pck: ModuleType) List[ImportableProcess][source]

Iterate through the given process package and find PLProcess classes.

Specifying the second argument (prefix) to iter_modules makes the returned name an absolute name instead of a relative one. This allows import_module to work without having to do additional modification to the name. s. https://packaging.python.org/guides/creating-and-discovering-plugins/

static _is_importable_process_type(obj: object, module: ModuleType) bool[source]
static create_process(importable_process: ImportableProcess) PLProcess[source]
static get_processes(pck: ModuleType) List[ImportableProcess][source]