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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
ed6b7d57
Commit
ed6b7d57
authored
Jan 26, 2022
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
ENH: files can now be added in yml format
parent
3885ce60
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!53
Release 0.1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/newcrawler/converters.py
+11
-1
11 additions, 1 deletion
src/newcrawler/converters.py
with
11 additions
and
1 deletion
src/newcrawler/converters.py
+
11
−
1
View file @
ed6b7d57
...
@@ -220,6 +220,11 @@ class Converter(object):
...
@@ -220,6 +220,11 @@ class Converter(object):
if
"
records
"
not
in
self
.
definition
:
if
"
records
"
not
in
self
.
definition
:
return
[]
return
[]
role
=
"
Record
"
# This allows us to create e.g. Files
if
"
role
"
in
self
.
definition
:
role
=
self
.
definition
[
"
role
"
]
# list of keys to identify, which variables have been set by which paths:
# list of keys to identify, which variables have been set by which paths:
# these are tuples:
# these are tuples:
# 0: record name
# 0: record name
...
@@ -230,7 +235,12 @@ class Converter(object):
...
@@ -230,7 +235,12 @@ class Converter(object):
# whether the record already exists in the store or not are actually really
# whether the record already exists in the store or not are actually really
# different distinct cases for treating the setting and updating of variables:
# different distinct cases for treating the setting and updating of variables:
if
name
not
in
records
:
if
name
not
in
records
:
if
role
==
"
Record
"
:
c_record
=
db
.
Record
()
c_record
=
db
.
Record
()
elif
role
==
"
File
"
:
c_record
=
db
.
File
()
else
:
raise
RuntimeError
(
"
Role {} not supported.
"
.
format
(
role
))
# add the new record to the record store:
# add the new record to the record store:
records
[
name
]
=
c_record
records
[
name
]
=
c_record
# additionally add the new record to the general store:
# additionally add the new record to the general store:
...
...
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