Skip to content

Commit 1fe212f

Browse files
authored
WorkspaceBuilder: Harden typings (#857)
2 parents a7ea98c + 5cbafd6 commit 1fe212f

File tree

8 files changed

+298
-249
lines changed

8 files changed

+298
-249
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
2929

3030
- Fix resolution of direcotries
3131

32+
- WorkspaceBuilder: Require `Server` in constructor (#857)
33+
3234
## tmuxp 1.23.0 (_yanked_, 2022-12-28)
3335

3436
_Yanked release: `tmuxp load` issues, see #856_

src/tmuxp/cli/load.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ def set_layout_hook(session: Session, hook_name: str) -> None:
107107
session.cmd(*cmd)
108108

109109

110-
def load_plugins(sconf: t.Dict[str, t.Any]) -> t.List[t.Any]:
110+
def load_plugins(session_config: t.Dict[str, t.Any]) -> t.List[t.Any]:
111111
"""
112112
Load and return plugins in workspace
113113
"""
114114
plugins = []
115-
if "plugins" in sconf:
116-
for plugin in sconf["plugins"]:
115+
if "plugins" in session_config:
116+
for plugin in session_config["plugins"]:
117117
try:
118118
module_name = plugin.split(".")
119119
module_name = ".".join(module_name[:-1])
@@ -396,7 +396,9 @@ def load_workspace(
396396

397397
try: # load WorkspaceBuilder object for tmuxp workspace / tmux server
398398
builder = WorkspaceBuilder(
399-
sconf=expanded_workspace, plugins=load_plugins(expanded_workspace), server=t
399+
session_config=expanded_workspace,
400+
plugins=load_plugins(expanded_workspace),
401+
server=t,
400402
)
401403
except exc.EmptyWorkspaceException:
402404
tmuxp_echo("%s is empty or parsed no workspace data" % workspace_file)

0 commit comments

Comments
 (0)