Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

tmuxp.workspace.builder.resolve_builder_paths

Python
  • Python
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

tmuxp.workspace.builder.resolve_builder_paths ( session_config : dict[str, t.Any] , workspace_file : str | os.PathLike[str] | None = None ) → list[pathlib.Path]
function [source]
function [source]
tmuxp.workspace.builder.resolve_builder_paths

Resolve and validate trusted workspace_builder_paths import roots.

Each entry is shell-expanded (~ and $VARS), resolved relative to the workspace file's directory when not absolute, and required to be an existing directory. Returns [] when the key is absent, so existing workspaces add nothing to sys.path.

Examples

Absent key resolves to an empty list (no-op for existing workspaces):

>>> resolve_builder_paths({}, None)
[]

An existing directory is resolved:

>>> root = tmp_path / "roots"
>>> root.mkdir()
>>> resolve_builder_paths({"workspace_builder_paths": [str(root)]}, None) == [
... root.resolve()
... ]
True

A missing directory is rejected:

>>> resolve_builder_paths(
... {"workspace_builder_paths": [str(tmp_path / "missing")]}, None
... )
Traceback (most recent call last):
...
tmuxp.exc.WorkspaceBuilderPathError: ...
Parameters
  • session_config ( dict[str, t.Any] ) – the expanded workspace configuration

  • workspace_file ( str | os.PathLike[str] | None ) – path to the workspace file; its parent anchors relative entries

Returns

list of pathlib.Path

Esc

Type to search.