14
14
from tmuxp import exc
15
15
from tmuxp .cli .load import load_plugins
16
16
from tmuxp .config_reader import ConfigReader
17
- from tmuxp .workspace import config
17
+ from tmuxp .workspace import loader
18
18
from tmuxp .workspace .builder import WorkspaceBuilder
19
19
20
20
from ..constants import EXAMPLE_PATH , FIXTURE_PATH
@@ -70,8 +70,8 @@ def test_focus_pane_index(session):
70
70
workspace = ConfigReader ._from_file (
71
71
test_utils .get_workspace_file ("workspace/builder/focus_and_pane.yaml" )
72
72
)
73
- workspace = config .expand (workspace )
74
- workspace = config .trickle (workspace )
73
+ workspace = loader .expand (workspace )
74
+ workspace = loader .trickle (workspace )
75
75
76
76
builder = WorkspaceBuilder (sconf = workspace )
77
77
@@ -144,8 +144,8 @@ def test_suppress_history(session):
144
144
workspace = ConfigReader ._from_file (
145
145
test_utils .get_workspace_file ("workspace/builder/suppress_history.yaml" )
146
146
)
147
- workspace = config .expand (workspace )
148
- workspace = config .trickle (workspace )
147
+ workspace = loader .expand (workspace )
148
+ workspace = loader .trickle (workspace )
149
149
150
150
builder = WorkspaceBuilder (sconf = workspace )
151
151
builder .build (session = session )
@@ -198,7 +198,7 @@ def test_session_options(session):
198
198
workspace = ConfigReader ._from_file (
199
199
test_utils .get_workspace_file ("workspace/builder/session_options.yaml" )
200
200
)
201
- workspace = config .expand (workspace )
201
+ workspace = loader .expand (workspace )
202
202
203
203
builder = WorkspaceBuilder (sconf = workspace )
204
204
builder .build (session = session )
@@ -211,7 +211,7 @@ def test_global_options(session):
211
211
workspace = ConfigReader ._from_file (
212
212
test_utils .get_workspace_file ("workspace/builder/global_options.yaml" )
213
213
)
214
- workspace = config .expand (workspace )
214
+ workspace = loader .expand (workspace )
215
215
216
216
builder = WorkspaceBuilder (sconf = workspace )
217
217
builder .build (session = session )
@@ -231,7 +231,7 @@ def test_global_session_env_options(session, monkeypatch):
231
231
workspace = ConfigReader ._from_file (
232
232
test_utils .get_workspace_file ("workspace/builder/env_var_options.yaml" )
233
233
)
234
- workspace = config .expand (workspace )
234
+ workspace = loader .expand (workspace )
235
235
236
236
builder = WorkspaceBuilder (sconf = workspace )
237
237
builder .build (session = session )
@@ -247,7 +247,7 @@ def test_window_options(session):
247
247
workspace = ConfigReader ._from_file (
248
248
test_utils .get_workspace_file ("workspace/builder/window_options.yaml" )
249
249
)
250
- workspace = config .expand (workspace )
250
+ workspace = loader .expand (workspace )
251
251
252
252
if has_gte_version ("2.3" ):
253
253
workspace ["windows" ][0 ]["options" ]["pane-border-format" ] = " #P "
@@ -276,7 +276,7 @@ def test_window_options_after(session):
276
276
workspace = ConfigReader ._from_file (
277
277
test_utils .get_workspace_file ("workspace/builder/window_options_after.yaml" )
278
278
)
279
- workspace = config .expand (workspace )
279
+ workspace = loader .expand (workspace )
280
280
281
281
builder = WorkspaceBuilder (sconf = workspace )
282
282
builder .build (session = session )
@@ -314,7 +314,7 @@ def test_window_shell(session):
314
314
workspace = ConfigReader ._from_file (
315
315
test_utils .get_workspace_file ("workspace/builder/window_shell.yaml" )
316
316
)
317
- workspace = config .expand (workspace )
317
+ workspace = loader .expand (workspace )
318
318
319
319
builder = WorkspaceBuilder (sconf = workspace )
320
320
@@ -335,7 +335,7 @@ def test_environment_variables(session):
335
335
workspace = ConfigReader ._from_file (
336
336
test_utils .get_workspace_file ("workspace/builder/environment_vars.yaml" )
337
337
)
338
- workspace = config .expand (workspace )
338
+ workspace = loader .expand (workspace )
339
339
340
340
builder = WorkspaceBuilder (sconf = workspace )
341
341
builder .build (session )
@@ -404,7 +404,7 @@ def test_blank_pane_count(session):
404
404
yaml_workspace_file = EXAMPLE_PATH / "blank-panes.yaml"
405
405
test_config = ConfigReader ._from_file (yaml_workspace_file )
406
406
407
- test_config = config .expand (test_config )
407
+ test_config = loader .expand (test_config )
408
408
builder = WorkspaceBuilder (sconf = test_config )
409
409
builder .build (session = session )
410
410
@@ -433,8 +433,8 @@ def test_start_directory(session, tmp_path: pathlib.Path):
433
433
test_config = yaml_workspace .format (TEST_DIR = test_dir )
434
434
435
435
workspace = ConfigReader ._load (format = "yaml" , content = test_config )
436
- workspace = config .expand (workspace )
437
- workspace = config .trickle (workspace )
436
+ workspace = loader .expand (workspace )
437
+ workspace = loader .trickle (workspace )
438
438
439
439
builder = WorkspaceBuilder (sconf = workspace )
440
440
builder .build (session = session )
@@ -479,9 +479,9 @@ def test_start_directory_relative(session, tmp_path: pathlib.Path):
479
479
workspace = ConfigReader ._load (format = "yaml" , content = test_config )
480
480
# the second argument of os.getcwd() mimics the behavior
481
481
# the CLI loader will do, but it passes in the workspace file's location.
482
- workspace = config .expand (workspace , config_dir )
482
+ workspace = loader .expand (workspace , config_dir )
483
483
484
- workspace = config .trickle (workspace )
484
+ workspace = loader .trickle (workspace )
485
485
486
486
assert os .path .exists (config_dir )
487
487
assert os .path .exists (test_dir )
@@ -513,8 +513,8 @@ def test_start_directory_sets_session_path(server):
513
513
"workspace/builder/start_directory_session_path.yaml"
514
514
)
515
515
)
516
- workspace = config .expand (workspace )
517
- workspace = config .trickle (workspace )
516
+ workspace = loader .expand (workspace )
517
+ workspace = loader .trickle (workspace )
518
518
519
519
builder = WorkspaceBuilder (sconf = workspace , server = server )
520
520
builder .build ()
@@ -544,8 +544,8 @@ def test_pane_order(session):
544
544
]
545
545
546
546
workspace = ConfigReader ._load (format = "yaml" , content = yaml_workspace )
547
- workspace = config .expand (workspace )
548
- workspace = config .trickle (workspace )
547
+ workspace = loader .expand (workspace )
548
+ workspace = loader .trickle (workspace )
549
549
550
550
builder = WorkspaceBuilder (sconf = workspace )
551
551
@@ -586,8 +586,8 @@ def test_window_index(session):
586
586
workspace = ConfigReader ._from_file (
587
587
test_utils .get_workspace_file ("workspace/builder/window_index.yaml" )
588
588
)
589
- workspace = config .expand (workspace )
590
- workspace = config .trickle (workspace )
589
+ workspace = loader .expand (workspace )
590
+ workspace = loader .trickle (workspace )
591
591
592
592
builder = WorkspaceBuilder (sconf = workspace )
593
593
@@ -605,8 +605,8 @@ def test_before_load_throw_error_if_retcode_error(server):
605
605
)
606
606
607
607
workspace = ConfigReader ._load (format = "yaml" , content = yaml_workspace )
608
- workspace = config .expand (workspace )
609
- workspace = config .trickle (workspace )
608
+ workspace = loader .expand (workspace )
609
+ workspace = loader .trickle (workspace )
610
610
611
611
builder = WorkspaceBuilder (sconf = workspace )
612
612
@@ -628,8 +628,8 @@ def test_before_load_throw_error_if_file_not_exists(server):
628
628
script_not_exists = FIXTURE_PATH / "script_not_exists.sh" ,
629
629
)
630
630
workspace = ConfigReader ._load (format = "yaml" , content = yaml_workspace )
631
- workspace = config .expand (workspace )
632
- workspace = config .trickle (workspace )
631
+ workspace = loader .expand (workspace )
632
+ workspace = loader .trickle (workspace )
633
633
634
634
builder = WorkspaceBuilder (sconf = workspace )
635
635
@@ -653,8 +653,8 @@ def test_before_load_true_if_test_passes(server):
653
653
654
654
yaml_workspace = config_script_completes .format (script_complete = script_complete_sh )
655
655
workspace = ConfigReader ._load (format = "yaml" , content = yaml_workspace )
656
- workspace = config .expand (workspace )
657
- workspace = config .trickle (workspace )
656
+ workspace = loader .expand (workspace )
657
+ workspace = loader .trickle (workspace )
658
658
659
659
builder = WorkspaceBuilder (sconf = workspace )
660
660
@@ -672,8 +672,8 @@ def test_before_load_true_if_test_passes_with_args(server):
672
672
yaml_workspace = config_script_completes .format (script_complete = script_complete_sh )
673
673
674
674
workspace = ConfigReader ._load (format = "yaml" , content = yaml_workspace )
675
- workspace = config .expand (workspace )
676
- workspace = config .trickle (workspace )
675
+ workspace = loader .expand (workspace )
676
+ workspace = loader .trickle (workspace )
677
677
678
678
builder = WorkspaceBuilder (sconf = workspace )
679
679
@@ -687,7 +687,7 @@ def test_plugin_system_before_workspace_builder(
687
687
workspace = ConfigReader ._from_file (
688
688
path = test_utils .get_workspace_file ("workspace/builder/plugin_bwb.yaml" )
689
689
)
690
- workspace = config .expand (workspace )
690
+ workspace = loader .expand (workspace )
691
691
692
692
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
693
693
assert len (builder .plugins ) > 0
@@ -702,7 +702,7 @@ def test_plugin_system_on_window_create(monkeypatch_plugin_test_packages, sessio
702
702
workspace = ConfigReader ._from_file (
703
703
path = test_utils .get_workspace_file ("workspace/builder/plugin_owc.yaml" )
704
704
)
705
- workspace = config .expand (workspace )
705
+ workspace = loader .expand (workspace )
706
706
707
707
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
708
708
assert len (builder .plugins ) > 0
@@ -717,7 +717,7 @@ def test_plugin_system_after_window_finished(monkeypatch_plugin_test_packages, s
717
717
workspace = ConfigReader ._from_file (
718
718
path = test_utils .get_workspace_file ("workspace/builder/plugin_awf.yaml" )
719
719
)
720
- workspace = config .expand (workspace )
720
+ workspace = loader .expand (workspace )
721
721
722
722
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
723
723
assert len (builder .plugins ) > 0
@@ -734,7 +734,7 @@ def test_plugin_system_on_window_create_multiple_windows(session):
734
734
"workspace/builder/plugin_owc_multiple_windows.yaml"
735
735
)
736
736
)
737
- workspace = config .expand (workspace )
737
+ workspace = loader .expand (workspace )
738
738
739
739
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
740
740
assert len (builder .plugins ) > 0
@@ -754,7 +754,7 @@ def test_plugin_system_after_window_finished_multiple_windows(
754
754
"workspace/builder/plugin_awf_multiple_windows.yaml"
755
755
)
756
756
)
757
- workspace = config .expand (workspace )
757
+ workspace = loader .expand (workspace )
758
758
759
759
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
760
760
assert len (builder .plugins ) > 0
@@ -772,7 +772,7 @@ def test_plugin_system_multiple_plugins(monkeypatch_plugin_test_packages, sessio
772
772
"workspace/builder/plugin_multiple_plugins.yaml"
773
773
)
774
774
)
775
- workspace = config .expand (workspace )
775
+ workspace = loader .expand (workspace )
776
776
777
777
builder = WorkspaceBuilder (sconf = workspace , plugins = load_plugins (workspace ))
778
778
assert len (builder .plugins ) > 0
@@ -1005,8 +1005,8 @@ def test_load_workspace_enter(
1005
1005
yaml_workspace = tmp_path / "simple.yaml"
1006
1006
yaml_workspace .write_text (yaml , encoding = "utf-8" )
1007
1007
workspace = ConfigReader ._from_file (yaml_workspace )
1008
- workspace = config .expand (workspace )
1009
- workspace = config .trickle (workspace )
1008
+ workspace = loader .expand (workspace )
1009
+ workspace = loader .trickle (workspace )
1010
1010
builder = WorkspaceBuilder (sconf = workspace , server = server )
1011
1011
builder .build ()
1012
1012
@@ -1125,8 +1125,8 @@ def test_load_workspace_sleep(
1125
1125
yaml_workspace = tmp_path / "simple.yaml"
1126
1126
yaml_workspace .write_text (yaml , encoding = "utf-8" )
1127
1127
workspace = ConfigReader ._from_file (yaml_workspace )
1128
- workspace = config .expand (workspace )
1129
- workspace = config .trickle (workspace )
1128
+ workspace = loader .expand (workspace )
1129
+ workspace = loader .trickle (workspace )
1130
1130
builder = WorkspaceBuilder (sconf = workspace , server = server )
1131
1131
1132
1132
t = time .process_time ()
@@ -1151,8 +1151,8 @@ def test_first_pane_start_directory(session, tmp_path: pathlib.Path):
1151
1151
)
1152
1152
1153
1153
workspace = ConfigReader ._from_file (yaml_workspace )
1154
- workspace = config .expand (workspace )
1155
- workspace = config .trickle (workspace )
1154
+ workspace = loader .expand (workspace )
1155
+ workspace = loader .trickle (workspace )
1156
1156
1157
1157
builder = WorkspaceBuilder (sconf = workspace )
1158
1158
builder .build (session = session )
@@ -1268,8 +1268,8 @@ def test_issue_800_default_size_many_windows(
1268
1268
)
1269
1269
1270
1270
workspace = ConfigReader ._from_file (yaml_workspace )
1271
- workspace = config .expand (workspace )
1272
- workspace = config .trickle (workspace )
1271
+ workspace = loader .expand (workspace )
1272
+ workspace = loader .trickle (workspace )
1273
1273
1274
1274
if isinstance (confoverrides , dict ):
1275
1275
for k , v in confoverrides .items ():
0 commit comments