Config - vcspull.config
¶
Configuration functionality for vcspull.
- vcspull.config.expand_dir(_dir, cwd=<bound method PathBase.cwd of <class 'pathlib._local.Path'>>)[source]¶
Return path with environmental variables and tilde ~ expanded.
- Return type:
Path
- Parameters:
_dir (pathlib.Path)
cwd (pathlib.Path, optional) – current working dir (for deciphering relative _dir paths), defaults to
os.getcwd()
- Returns:
Absolute directory path
- Return type:
- vcspull.config.extract_repos(config, cwd=<bound method PathBase.cwd of <class 'pathlib._local.Path'>>)[source]¶
Return expanded configuration.
end-user configuration permit inline configuration shortcuts, expand to identical format for parsing.
- Return type:
list
[ConfigDict]- Parameters:
cwd (pathlib.Path) – current working dir (for deciphering relative paths)
- Returns:
list
- Return type:
List of normalized repository information
- vcspull.config.find_home_config_files(filetype=None)[source]¶
Return configs of
.vcspull.{yaml,json}
in user’s home directory.
- vcspull.config.find_config_files(path=None, match=None, filetype=None, include_home=False)[source]¶
Return repos from a directory and match. Not recursive.
- Return type:
list
[Path
]- Parameters:
- Raises:
LoadConfigRepoConflict : – There are two configs that have same path and name with different repo urls.
- Returns:
list of absolute paths to config files.
- Return type:
- vcspull.config.load_configs(files, cwd=<bound method PathBase.cwd of <class 'pathlib._local.Path'>>)[source]¶
Return repos from a list of files.
- Return type:
list
[ConfigDict]- Parameters:
files (list) – paths to config file
cwd (pathlib.Path) – current path (pass down for
extract_repos()
- Returns:
expanded config dict item
- Return type:
- vcspull.config.detect_duplicate_repos(config1, config2)[source]¶
Return duplicate repos dict if repo_dir same and vcs different.
- Return type:
- Parameters:
config1 (list[ConfigDict])
config2 (list[ConfigDict])
- Returns:
List of duplicate tuples
- Return type:
list[ConfigDictTuple]
- vcspull.config.in_dir(config_dir=None, extensions=None)[source]¶
Return a list of configs in
config_dir
.
- vcspull.config.filter_repos(config, path=None, vcs_url=None, name=None)[source]¶
Return a
list
list of repos from (expanded) config file.path, vcs_url and name all support fnmatch.
- Return type:
list
[ConfigDict]- Parameters:
- Returns:
Repos
- Return type: