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
10f70268
Commit
10f70268
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
DOC: fix docstrings
parent
77d9a9ee
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!91
Release 0.3
,
!67
MAINT: introduce an identifiable class
Pipeline
#30766
passed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/crawl.py
+9
-32
9 additions, 32 deletions
src/caoscrawler/crawl.py
with
9 additions
and
32 deletions
src/caoscrawler/crawl.py
+
9
−
32
View file @
10f70268
...
@@ -656,53 +656,30 @@ class Crawler(object):
...
@@ -656,53 +656,30 @@ class Crawler(object):
def
add_to_remote_missing_cache
(
self
,
record
:
db
.
Record
):
def
add_to_remote_missing_cache
(
self
,
record
:
db
.
Record
):
"""
"""
add
s the given
identifiable to the local
cache
store
s the given
Record in the remote_missing_
cache
.
No identifiable with the same values must exist locally.
If no identifiable can be created for the given Record, the Record is NOT stored.
(Each identifiable that is not found on the remote server, is
'
cached
'
locally to prevent
that the same identifiable exists twice)
Return False if there is no identifiable for this record and True otherwise.
"""
"""
self
.
add_to_cache
(
record
=
record
,
cache
=
self
.
remote_missing_cache
)
self
.
add_to_cache
(
record
=
record
,
cache
=
self
.
remote_missing_cache
)
def
add_to_remote_existing_cache
(
self
,
record
:
db
.
Record
):
def
add_to_remote_existing_cache
(
self
,
record
:
db
.
Record
):
"""
"""
adds the given identifiable to the local cache
stores the given Record in the remote_existing_cache.
No identifiable with the same values must exist locally.
(Each identifiable that is not found on the remote server, is
'
cached
'
locally to prevent
that the same identifiable exists twice)
Return False if there is no identifiable for this record and True otherwise
.
If no identifiable can be created for the given Record, the Record is NOT stored
.
"""
"""
self
.
add_to_cache
(
record
=
record
,
cache
=
self
.
remote_existing_cache
)
self
.
add_to_cache
(
record
=
record
,
cache
=
self
.
remote_existing_cache
)
def
add_to_cache
(
self
,
record
:
db
.
Record
,
cache
):
def
add_to_cache
(
self
,
record
:
db
.
Record
,
cache
)
->
Union
[
Identifiable
,
None
]
:
"""
"""
add
s the given
identifiable to the local
cache
store
s the given
Record in the given
cache
.
No identifiable with the same values must exist locally.
If no identifiable can be created for the given Record, the Record is NOT stored.
(Each identifiable that is not found on the remote server, is
'
cached
'
locally to prevent
that the same identifiable exists twice)
Return False if there is no identifiable for this record and True otherwise.
"""
"""
if
self
.
identifiableAdapter
is
None
:
if
self
.
identifiableAdapter
is
None
:
raise
RuntimeError
(
"
Should not happen.
"
)
raise
RuntimeError
(
"
Should not happen.
"
)
identifiable
=
self
.
identifiableAdapter
.
get_identifiable
(
record
)
identifiable
=
self
.
identifiableAdapter
.
get_identifiable
(
record
)
if
identifiable
is
None
:
if
identifiable
is
not
None
:
# TODO: this error report is bad
# we need appropriate handling for records without an identifiable
# or at least a simple fallback definition if tehre is no identifiable.
# print(record)
# raise RuntimeError("No identifiable for record.")
# TODO: check whether that holds:
# if there is no identifiable, for the cache that is the same
# as if the complete entity is the identifiable:
return
cache
.
add
(
identifiable
=
identifiable
,
record
=
record
)
cache
.
add
(
identifiable
=
identifiable
,
record
=
record
)
@staticmethod
@staticmethod
...
...
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