fromtree_utils.fs_recursionimportRecursionStrategy, ProcessingFunctions, fs_tree_recursion, TreeNodeFunctions, get_children_pathsfromtree_utils.tree_recursionimportProcessingFunctions, RecursionStrategy, TreeNodeFunctionsdefexample_extract_file_paths(root_dir_path: str, options={}, mode=RecursionStrategy.ANY):
tree_node_functions: TreeNodeFunctions=TreeNodeFunctions()
defprocess_file(path: str):
logging.debug(f"Processing file: {path}")
print(path)
# Return the path as the desired content extracted from the nodereturnpathdefprocess_dir(dir_path: str, children_paths: list[str], children_processing_results: list[str]):
# The paths we returned in 'process_file' are collected and passed to the 'process_dir' function as the children_processing_resultslogging.debug(f"Processing dir: {dir_path}")
returnchildren_processing_resultstree_node_functions.is_leaf=os.path.isfiletree_node_functions.is_node=os.path.isdirtree_node_functions.get_children_ids=get_children_pathstree_node_functions.process_leaf=process_filetree_node_functions.process_node=process_dirreturnfs_tree_recursion(root_dir_path, tree_node_functions, options, mode=mode)
example_extract_file_paths('/some/path')