tmuxp.workspace.builder.resolve_builder_class
- tmuxp.workspace.builder.resolve_builder_class ( session_config: dict[str, t
.Any ], ) type[WorkspaceBuilder ]Protocol -
Resolve the workspace builder class selected by
session_config.Description#
Resolution of the
workspace_buildervalue:- absent/empty → the classic
ClassicWorkspaceBuilder(no import, no entry-point scan); - contains
:→ amodule:attrobject reference; - no
.and no:→ an entry-point name in thetmuxp.workspace_buildersgroup; - dotted, no
:→ an entry-point name if registered, otherwise amodule.attrdotted path.
Examples#
The default resolves to the classic builder without importing anything:
>>> from tmuxp.workspace.builder.classic import ClassicWorkspaceBuilder>>> resolve_builder_class({}) is ClassicWorkspaceBuilderTrueA dotted
module:attrreference is imported and validated:>>> resolve_builder_class(... {... "workspace_builder": (... "tmuxp.workspace.builder.classic:ClassicWorkspaceBuilder"... )... }... ) is ClassicWorkspaceBuilderTrue- Parameters
-
-
session_config(dict[str, t.Any ]) # – the expanded workspace configuration
-
- Returns
-
type a workspace builder class (or builder factory) satisfying
WorkspaceBuilderProtocol
- absent/empty → the classic