Finders - tmuxp.workspace.finders
#
Workspace (configuration file) finders for tmuxp.
- tmuxp.workspace.finders.is_workspace_file(filename, extensions=None)[source]#
Return True if file has a valid workspace file type.
- tmuxp.workspace.finders.in_dir(workspace_dir=None, extensions=None)[source]#
Return a list of workspace_files in
workspace_dir
.
- tmuxp.workspace.finders.in_cwd()[source]#
Return list of workspace_files in current working directory.
If filename is
.tmuxp.py
,.tmuxp.json
,.tmuxp.yaml
.Examples
>>> sorted(in_cwd()) ['.tmuxp.json', '.tmuxp.yaml']
- tmuxp.workspace.finders.get_workspace_dir()[source]#
Return tmuxp workspace directory.
TMUXP_CONFIGDIR
environmental variable has precedence if set. We also evaluate XDG default directory from XDG_CONFIG_HOME environmental variable if set or its default. Then the old default ~/.tmuxp is returned for compatibility.
- tmuxp.workspace.finders.find_workspace_file(workspace_file, workspace_dir=None)[source]#
Return the real config path or raise an exception.
If workspace file is directory, scan for .tmuxp.{yaml,yml,json} in directory. If one or more found, it will warn and pick the first.
If workspace file is “.”, “./” or None, it will scan current directory.
If workspace file is has no path and only a filename, e.g. “my_workspace.yaml” it will search workspace dir.
If workspace file has no path and no extension, e.g. “my_workspace”, it will scan for file name with yaml, yml and json. If multiple exist, it will warn and pick the first.