From b4783ea58f3b41d61b44786678bda2fbd45f253e Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander@mail-schlemmer.de> Date: Mon, 21 Aug 2023 16:42:57 +0200 Subject: [PATCH] DOC: more documentation for restricted path --- src/caoscrawler/crawl.py | 3 ++- src/caoscrawler/scanner.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 6d26553b..ad320c6f 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -1283,7 +1283,8 @@ def crawler_main(crawled_directory_path: str, whether or not to update or insert entities inspite of name conflicts restricted_path: optional, list of strings Traverse the data tree only along the given path. When the end of the given path - is reached, traverse the full tree as normal. + is reached, traverse the full tree as normal. See docstring of 'scanner' in + module 'scanner' for more details. remove_prefix : Optional[str] Remove the given prefix from file paths. See docstring of '_fix_file_paths' for more details. diff --git a/src/caoscrawler/scanner.py b/src/caoscrawler/scanner.py index c5e078c5..5bd662d3 100644 --- a/src/caoscrawler/scanner.py +++ b/src/caoscrawler/scanner.py @@ -235,7 +235,7 @@ def scanner(items: list[StructureElement], restricted_path: optional, list of strings, traverse the data tree only along the given path. For example, when a directory contains files a, b and c and b is - given in restricted_path, a and c will be ignroed by the crawler. + given as restricted_path, a and c will be ignroed by the crawler. When the end of the given path is reached, traverse the full tree as normal. The first element of the list provided by restricted_path should be the name of the StructureElement at this level, i.e. denoting the @@ -357,7 +357,8 @@ def scan_directory(dirname: str, crawler_definition_path: str, restricted_path: optional, list of strings Traverse the data tree only along the given path. When the end of the given path - is reached, traverse the full tree as normal. + is reached, traverse the full tree as normal. See docstring of 'scanner' for + more details. """ crawler_definition = load_definition(crawler_definition_path) @@ -408,7 +409,8 @@ def scan_structure_elements(items: Union[list[StructureElement], StructureElemen file. restricted_path: optional, list of strings Traverse the data tree only along the given path. When the end of the given path - is reached, traverse the full tree as normal. + is reached, traverse the full tree as normal. See docstring of 'scanner' for + more details. Returns ------- -- GitLab