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

ENH: crawler definition may now contain up to two documents

parent df5b7908
Branches
Tags
2 merge requests!53Release 0.1,!25F macros
Pipeline #28542 failed
......@@ -230,7 +230,16 @@ class Crawler(object):
# Load the cfood from a yaml file:
with open(crawler_definition_path, "r") as f:
crawler_definition = yaml.safe_load(f)
crawler_definitions = list(yaml.safe_load_all(f))
if len(crawler_definitions) == 1:
# Simple case, just one document:
crawler_definition = crawler_definitions[0]
elif len(crawler_definition) == 2:
crawler_definition = crawler_definitions[1]
else:
raise RuntimeError("Crawler definition must not contain more than two documents.")
# TODO: at this point this function can already load the cfood schema extensions
# from the crawler definition and add them to the yaml schema that will be
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment