Skip to content

Commit f7d801d

Browse files
committed
chore(workspace[finders]): config to workspace
1 parent 42ce32e commit f7d801d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/tmuxp/workspace/finders.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def is_workspace_file(filename, extensions=[".yml", ".yaml", ".json"]):
3131

3232

3333
def in_dir(
34-
config_dir=os.path.expanduser("~/.tmuxp"), extensions=[".yml", ".yaml", ".json"]
34+
workspace_dir=os.path.expanduser("~/.tmuxp"), extensions=[".yml", ".yaml", ".json"]
3535
):
3636
"""
37-
Return a list of configs in ``config_dir``.
37+
Return a list of workspace_files in ``workspace_dir``.
3838
3939
Parameters
4040
----------
41-
config_dir : str
41+
workspace_dir : str
4242
directory to search
4343
extensions : list
4444
filetypes to check (e.g. ``['.yaml', '.json']``).
@@ -47,38 +47,38 @@ def in_dir(
4747
-------
4848
list
4949
"""
50-
configs = []
50+
workspace_files = []
5151

52-
for filename in os.listdir(config_dir):
52+
for filename in os.listdir(workspace_dir):
5353
if is_workspace_file(filename, extensions) and not filename.startswith("."):
54-
configs.append(filename)
54+
workspace_files.append(filename)
5555

56-
return configs
56+
return workspace_files
5757

5858

5959
def in_cwd():
6060
"""
61-
Return list of configs in current working directory.
61+
Return list of workspace_files in current working directory.
6262
6363
If filename is ``.tmuxp.py``, ``.tmuxp.json``, ``.tmuxp.yaml``.
6464
6565
Returns
6666
-------
6767
list
68-
configs in current working directory
68+
workspace_files in current working directory
6969
7070
Examples
7171
--------
7272
>>> sorted(in_cwd())
7373
['.tmuxp.json', '.tmuxp.yaml']
7474
"""
75-
configs = []
75+
workspace_files = []
7676

7777
for filename in os.listdir(os.getcwd()):
7878
if filename.startswith(".tmuxp") and is_workspace_file(filename):
79-
configs.append(filename)
79+
workspace_files.append(filename)
8080

81-
return configs
81+
return workspace_files
8282

8383

8484
def get_workspace_dir() -> str:
@@ -120,25 +120,25 @@ def find_workspace_file(
120120
"""
121121
Return the real config path or raise an exception.
122122
123-
If config is directory, scan for .tmuxp.{yaml,yml,json} in directory. If
123+
If workspace file is directory, scan for .tmuxp.{yaml,yml,json} in directory. If
124124
one or more found, it will warn and pick the first.
125125
126-
If config is ".", "./" or None, it will scan current directory.
126+
If workspace file is ".", "./" or None, it will scan current directory.
127127
128-
If config is has no path and only a filename, e.g. "myconfig.yaml" it will
129-
search config dir.
128+
If workspace file is has no path and only a filename, e.g. "my_workspace.yaml" it
129+
will search workspace dir.
130130
131-
If config has no path and only a name with no extension, e.g. "myconfig",
132-
it will scan for file name with yaml, yml and json. If multiple exist, it
133-
will warn and pick the first.
131+
If workspace file has no path and no extension, e.g. "my_workspace", it will scan
132+
for file name with yaml, yml and json. If multiple exist, it will warn and pick the
133+
first.
134134
135135
Parameters
136136
----------
137137
workspace_file : str
138138
workspace file, valid examples:
139139
140-
- a file name, myconfig.yaml
141-
- relative path, ../config.yaml or ../project
140+
- a file name, my_workspace.yaml
141+
- relative path, ../my_workspace.yaml or ../project
142142
- a period, .
143143
"""
144144
if not workspace_dir:
@@ -226,7 +226,7 @@ def is_pure_name(path: str) -> bool:
226226
Returns
227227
-------
228228
bool
229-
True if path is a name of config in config dir, not file path.
229+
True if path is a name of workspace in workspace dir, not file path.
230230
"""
231231
return (
232232
not os.path.isabs(path)

0 commit comments

Comments
 (0)