Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
4c7ef8cc
Commit
4c7ef8cc
authored
7 months ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
DOC: improved some documentation of scanner functions
parent
5068f0b3
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!198
REL: Release 0.10.0
,
!182
Better error message
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/scanner.py
+19
-2
19 additions, 2 deletions
src/caoscrawler/scanner.py
with
19 additions
and
2 deletions
src/caoscrawler/scanner.py
+
19
−
2
View file @
4c7ef8cc
...
...
@@ -55,10 +55,19 @@ from .version import check_cfood_version
logger
=
logging
.
getLogger
(
__name__
)
def
load_definition
(
crawler_definition_path
:
str
):
def
load_definition
(
crawler_definition_path
:
str
)
->
dict
:
"""
Load a cfood from a crawler definition defined by
crawler definition path and validate it using cfood-schema.yml.
Arguments:
----------
crawler_definition_path: str
Path to the crawler definition file in yaml format.
Returns:
--------
dict containing the crawler definition.
"""
# Load the cfood from a yaml file:
...
...
@@ -70,13 +79,21 @@ def load_definition(crawler_definition_path: str):
return
_resolve_validator_paths
(
crawler_definition
,
crawler_definition_path
)
def
_load_definition_from_yaml_dict
(
crawler_definitions
:
list
[
dict
]):
def
_load_definition_from_yaml_dict
(
crawler_definitions
:
list
[
dict
])
->
dict
:
"""
Load crawler definitions from a list of (yaml) dicts `crawler_definitions` which
contains either one or two documents.
Doesn
'
t resolve the validator paths in the cfood definition, so for
internal and testing use only.
Arguments:
----------
crawler_definitions: list[dict]
List of one or two dicts containing (optionally) metadata and the crawler definition.
Returns:
--------
dict containing the crawler definition.
"""
if
len
(
crawler_definitions
)
==
1
:
# Simple case, just one document:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment