timor.utilities.asset_handling
Functions
|
Find all appearances of key in a nested dict / sequence combination and return references to each. |
|
Check if all old_files exist as new_files and resolve missing according to handle_missing_assets. |
Module Contents
- timor.utilities.asset_handling.find_key(key, data, modifier=None, search_depth=20)
Find all appearances of key in a nested dict / sequence combination and return references to each.
- Parameters:
- Returns:
A tuple of lists of all found values with matching key before and after the applied modifier.
- Note:
- Return type:
Tuple[List[Any], List[Any]]
- timor.utilities.asset_handling.handle_assets(new_files, old_files, handle_missing_assets=DEFAULT_ASSETS_COPY_BEHAVIOR)
Check if all old_files exist as new_files and resolve missing according to handle_missing_assets.
- Parameters:
new_files (List[pathlib.Path]) – The list of files at the new location.
old_files (List[pathlib.Path]) – The list of files at the old location.
handle_missing_assets (Optional[str]) – How to handle missing assets at save_at location. * “warning”: Warn if missing. * “error”: Raise FileNotFoundError if missing. * “ignore”: Ignore missing. * “copy”: Copy missing from old to new location. * “symlink”: Symlink missing from old to new location.