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
ad5a3161
Commit
ad5a3161
authored
Feb 23, 2024
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: make more attributes properties
parent
432a0e90
No related branches found
No related tags found
1 merge request
!158
Unmodifiable Identifiables
Pipeline
#47756
canceled
Feb 23, 2024
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/identifiable.py
+25
-5
25 additions, 5 deletions
src/caoscrawler/identifiable.py
with
25 additions
and
5 deletions
src/caoscrawler/identifiable.py
+
25
−
5
View file @
ad5a3161
...
@@ -63,12 +63,12 @@ class Identifiable():
...
@@ -63,12 +63,12 @@ class Identifiable():
if
properties
is
not
None
and
'
name
'
in
[
k
.
lower
()
for
k
in
properties
.
keys
()]:
if
properties
is
not
None
and
'
name
'
in
[
k
.
lower
()
for
k
in
properties
.
keys
()]:
raise
ValueError
(
"
Please use the separete
'
name
'
keyword instead of the properties
"
raise
ValueError
(
"
Please use the separete
'
name
'
keyword instead of the properties
"
"
dict for name
"
)
"
dict for name
"
)
self
.
record_id
=
record_id
self
.
_
record_id
=
record_id
self
.
path
=
path
self
.
_
path
=
path
self
.
record_type
=
record_type
self
.
_
record_type
=
record_type
self
.
name
=
name
self
.
_
name
=
name
if
name
==
""
:
if
name
==
""
:
self
.
name
=
None
self
.
_
name
=
None
self
.
_properties
:
dict
=
{}
self
.
_properties
:
dict
=
{}
if
properties
is
not
None
:
if
properties
is
not
None
:
self
.
_properties
=
properties
self
.
_properties
=
properties
...
@@ -78,6 +78,26 @@ class Identifiable():
...
@@ -78,6 +78,26 @@ class Identifiable():
self
.
_representation
=
sha256
(
self
.
_representation
=
sha256
(
self
.
_create_hashable_string
(
self
).
encode
(
'
utf-8
'
)).
hexdigest
()
self
.
_create_hashable_string
(
self
).
encode
(
'
utf-8
'
)).
hexdigest
()
@property
def
record_id
(
self
):
"""
Read-only access to the record id.
"""
return
self
.
_record_id
.
copy
()
@property
def
path
(
self
):
"""
Read-only access to the path.
"""
return
self
.
_path
.
copy
()
@property
def
name
(
self
):
"""
Read-only access to the name.
"""
return
self
.
_name
.
copy
()
@property
def
record_type
(
self
):
"""
Read-only access to the record_type.
"""
return
self
.
_record_type
.
copy
()
@property
@property
def
properties
(
self
):
def
properties
(
self
):
"""
Read-only access to the properties.
"""
"""
Read-only access to the properties.
"""
...
...
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