@@ -31,14 +31,14 @@ def is_workspace_file(filename, extensions=[".yml", ".yaml", ".json"]):
31
31
32
32
33
33
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" ]
35
35
):
36
36
"""
37
- Return a list of configs in ``config_dir ``.
37
+ Return a list of workspace_files in ``workspace_dir ``.
38
38
39
39
Parameters
40
40
----------
41
- config_dir : str
41
+ workspace_dir : str
42
42
directory to search
43
43
extensions : list
44
44
filetypes to check (e.g. ``['.yaml', '.json']``).
@@ -47,38 +47,38 @@ def in_dir(
47
47
-------
48
48
list
49
49
"""
50
- configs = []
50
+ workspace_files = []
51
51
52
- for filename in os .listdir (config_dir ):
52
+ for filename in os .listdir (workspace_dir ):
53
53
if is_workspace_file (filename , extensions ) and not filename .startswith ("." ):
54
- configs .append (filename )
54
+ workspace_files .append (filename )
55
55
56
- return configs
56
+ return workspace_files
57
57
58
58
59
59
def in_cwd ():
60
60
"""
61
- Return list of configs in current working directory.
61
+ Return list of workspace_files in current working directory.
62
62
63
63
If filename is ``.tmuxp.py``, ``.tmuxp.json``, ``.tmuxp.yaml``.
64
64
65
65
Returns
66
66
-------
67
67
list
68
- configs in current working directory
68
+ workspace_files in current working directory
69
69
70
70
Examples
71
71
--------
72
72
>>> sorted(in_cwd())
73
73
['.tmuxp.json', '.tmuxp.yaml']
74
74
"""
75
- configs = []
75
+ workspace_files = []
76
76
77
77
for filename in os .listdir (os .getcwd ()):
78
78
if filename .startswith (".tmuxp" ) and is_workspace_file (filename ):
79
- configs .append (filename )
79
+ workspace_files .append (filename )
80
80
81
- return configs
81
+ return workspace_files
82
82
83
83
84
84
def get_workspace_dir () -> str :
@@ -120,25 +120,25 @@ def find_workspace_file(
120
120
"""
121
121
Return the real config path or raise an exception.
122
122
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
124
124
one or more found, it will warn and pick the first.
125
125
126
- If config is ".", "./" or None, it will scan current directory.
126
+ If workspace file is ".", "./" or None, it will scan current directory.
127
127
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.
130
130
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.
134
134
135
135
Parameters
136
136
----------
137
137
workspace_file : str
138
138
workspace file, valid examples:
139
139
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
142
142
- a period, .
143
143
"""
144
144
if not workspace_dir :
@@ -226,7 +226,7 @@ def is_pure_name(path: str) -> bool:
226
226
Returns
227
227
-------
228
228
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.
230
230
"""
231
231
return (
232
232
not os .path .isabs (path )
0 commit comments