avid.common.artefact.crawler.runCrawlerScriptMain
- avid.common.artefact.crawler.runCrawlerScriptMain(file_function: Callable, scan_directory_break_delegate: Callable[[DirEntry], bool] | None = None) None
Helper function for creating crawler scripts with command line interface.
This function provides a standard CLI interface for crawler scripts that need to crawl a root directory and store results to a file. It handles argument parsing and provides common options for crawler configuration.
- Parameters:
file_function – Function to call for each file found during crawling. Should at least accept path_parts, filename, and full_path as keyword arguments or swallow them as **kwargs.
scan_directory_break_delegate – Optional delegate to control directory scanning
- Raises:
SystemExit – On argument parsing errors or crawling failures
Command line arguments:
script.py <root_dir> <output_file> [--n_processes N] [--relative_paths] [--replace] root_dir: Directory to start crawling from output_file: XML file to save discovered artefacts to --n_processes: Number of parallel processes (default: 1) --relative_paths: Store paths relative to output file location --replace: Replace existing similar artefacts during crawling