Skip to content
Snippets Groups Projects
Commit e31941ef authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

DOC: ideas for a feature request for supporting else clauses

parent e73be6e5
No related branches found
No related tags found
1 merge request!98Draft: F converters else clause
Pipeline #33663 passed with warnings
...@@ -1141,6 +1141,7 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3])) ...@@ -1141,6 +1141,7 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3]))
# This path_found variable stores wether the path given by restricted_path was found in the # This path_found variable stores wether the path given by restricted_path was found in the
# data tree # data tree
path_found = False path_found = False
# at_least_one_match = False
if restricted_path is not None and len(restricted_path) == 0: if restricted_path is not None and len(restricted_path) == 0:
restricted_path = None restricted_path = None
...@@ -1152,6 +1153,7 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3])) ...@@ -1152,6 +1153,7 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3]))
if (converter.typecheck(element) and ( if (converter.typecheck(element) and (
restricted_path is None or element.name == restricted_path[0]) restricted_path is None or element.name == restricted_path[0])
and converter.match(element) is not None): and converter.match(element) is not None):
# at_least_one_match = True
path_found = True path_found = True
generalStore_copy = generalStore.create_scoped_copy() generalStore_copy = generalStore.create_scoped_copy()
recordStore_copy = recordStore.create_scoped_copy() recordStore_copy = recordStore.create_scoped_copy()
...@@ -1195,10 +1197,14 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3])) ...@@ -1195,10 +1197,14 @@ ____________________\n""".format(i + 1, len(pending_changes)) + str(el[3]))
structure_elements_path + [element.get_name()], structure_elements_path + [element.get_name()],
converters_path + [converter.name], converters_path + [converter.name],
restricted_path[1:] if restricted_path is not None else None) restricted_path[1:] if restricted_path is not None else None)
if restricted_path and not path_found: if restricted_path and not path_found:
raise RuntimeError("A 'restricted_path' argument was given that is not contained in " raise RuntimeError("A 'restricted_path' argument was given that is not contained in "
"the data tree") "the data tree")
# if not at_least_one_match:
# run_ELSE_converter()
# if the crawler is running out of scope, copy all records in # if the crawler is running out of scope, copy all records in
# the recordStore, that were created in this scope # the recordStore, that were created in this scope
# to the general update container. # to the general update container.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment