Utils
A collection of Helper functions.
contains_path ¶
Check if a subpath is included in another path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PurePath
|
Path you want to check |
required |
sub_path
|
PurePath
|
Subpath that should be included in path. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if path contains subpath |
Source code in b4_backup/utils.py
load_config ¶
Reads the config file and returns a config dataclass.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_path
|
Path
|
Path of the config file |
DEFAULT_CONFIG
|
overrides
|
list[str] | None
|
A list of dot list entries, which can override the values in the config. Used for CLI. |
None
|
Returns:
Type | Description |
---|---|
BaseConfig
|
Config object |