solidipes.scanners.scanner module
- class solidipes.scanners.scanner.DictTree(*args, **kwargs)[source]
Bases:
dict- filter(value_filter: ~typing.Callable = <function DictTree.<lambda>>, keys_join_func: ~typing.Callable[[list[str]], str] = <function DictTree.<lambda>>, joined_keys_filter: ~typing.Callable = <function DictTree.<lambda>>, keep_empty_dicts: bool = False, keys: list[str] = []) DictTree[source]
Filter the tree based on the values and keys. Both filters must be satisfied.
- flatten(value_func: ~typing.Callable = <function DictTree.<lambda>>, keys_join_func: ~typing.Callable[[list[str]], str] = <function DictTree.<lambda>>, add_dicts: bool = False, dict_func: ~typing.Callable = <function DictTree.<lambda>>, keys: list[str] = []) dict[source]
Flatten the tree into a flat dictionary.
- class solidipes.scanners.scanner.FileStruct(filepath: str, dirpath: str, full_filepath: str, virtual: bool = False, virtual_root: str = '', entry: dict = <factory>, uri: str = '', is_file: bool = True)[source]
Bases:
object- dirpath: str
- filepath: str
- full_filepath: str
- is_file: bool = True
- uri: str = ''
- virtual: bool = False
- virtual_root: str = ''
- class solidipes.scanners.scanner.Scanner(search_path='.', reload_excluded=True)[source]
Bases:
ABCA class to scan a directory to load files and groups.
All paths are given relative to the scanner’s root path.
- _abc_impl = <_abc._abc_data object>
- add_filepath(filestruct: FileStruct) None[source]
- convert_filepath_tree_to_loader_tree(filepath_tree: FilepathTree, current_dir: str = None, progress_bar: ProgressBar | None = None) DictTree[source]
Convert a tree of filepaths (relative to search path) to a tree of loaders, while detecting file groups.
- get_filtered_loader_dict(dirs: list[str] = [], recursive: bool = True) dict[str, File | Group][source]
Get a dictionary mapping paths (potentially grouped) to loaders.
- get_filtered_loader_tree(dirs: list[str] = [], recursive: bool = True) DictTree[source]
Get a tree of loaders for the given directories.
- abstractmethod get_loader(filestruct: FileStruct) File | Group[source]