Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Python Unified Device Interface
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Sensor Interfacing Language (SOIL)
Python Unified Device Interface
Commits
26a3ad59
Commit
26a3ad59
authored
1 year ago
by
Matthias Stefan Bodenbenner
Browse files
Options
Downloads
Patches
Plain Diff
fixed serialization of semantics
parent
31d937e4
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#375564
passed
1 year ago
Stage: build
Stage: push
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-1
4 additions, 1 deletion
README.md
setup.py
+1
-1
1 addition, 1 deletion
setup.py
src/http/server.py
+40
-38
40 additions, 38 deletions
src/http/server.py
with
45 additions
and
40 deletions
README.md
+
4
−
1
View file @
26a3ad59
[

](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/commits/master)
# Python Unified Device Interface
Current stable version: 9.3.
6
Current stable version: 9.3.
7
## Installation
1.
Install the WZL-UDI package via pip
...
...
@@ -58,6 +58,9 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
## Recent changes
**9.3.7**
- 2024-03-18
-
fixed serialization of semantics
**9.3.6**
- 2024-03-18
-
fixed serialization of semantic values
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
26a3ad59
...
...
@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description
=
fh
.
read
()
setup
(
name
=
'
wzl-udi
'
,
version
=
'
9.3.
6
'
,
version
=
'
9.3.
7
'
,
url
=
'
https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python
'
,
project_urls
=
{
"
Bug Tracker
"
:
"
https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python/-/issues
"
,
...
...
This diff is collapsed.
Click to expand it.
src/http/server.py
+
40
−
38
View file @
26a3ad59
...
...
@@ -197,6 +197,7 @@ class HTTPServer(object):
resource_type
=
HTTPServer
.
analyze_request_url
(
request
)
keys
=
self
.
_filter_query
(
request
.
query
)
try
:
if
resource_type
==
ResourceType
.
profile
:
if
self
.
_profiles_path
is
None
:
raise
UserException
(
'
Can
\'
t return requested metadata profile, as no profiles have been created for this sensor service.
'
)
...
...
@@ -219,6 +220,8 @@ class HTTPServer(object):
semantic_name
=
request
.
url
.
parts
[
-
2
]
if
request
.
url
.
parts
[
-
1
]
==
''
else
request
.
url
.
parts
[
-
1
]
item
,
resource_type
=
self
.
root
.
resolve_semantic_path
(
semantic_name
)
recursive
=
request
.
query
is
not
None
and
'
all
'
in
request
.
query
response
=
item
.
serialize_semantics
(
resource_type
,
recursive
)
else
:
assert
resource_type
==
ResourceType
.
element
uuids
=
HTTPServer
.
parse_uuids
(
request
)
...
...
@@ -229,19 +232,18 @@ class HTTPServer(object):
try
:
item
=
self
.
root
[
uuids
]
if
resource_type
.
is_semantic
():
recursive
=
request
.
query
is
not
None
and
'
all
'
in
request
.
query
response
=
item
.
serialize_semantics
(
resource_type
,
recursive
)
else
:
response
=
item
.
serialize
(
keys
,
self
.
_legacy_mode
,
HTTP_GET
)
except
KeyError
as
e
:
logger
.
error
(
traceback
.
format_exc
())
response
=
{
'
error
'
:
str
(
e
)}
logger
.
error
(
'
Response: {}
'
.
format
(
response
))
return
self
.
prepare_response
(
response
,
None
,
status
=
404
,
query
=
request
.
query
)
# serializing the element
try
:
if
resource_type
.
is_semantic
()
and
resource_type
!=
ResourceType
.
profile
:
recursive
=
request
.
query
is
not
None
and
'
all
'
in
request
.
query
response
=
item
.
serialize_semantics
(
resource_type
,
recursive
)
elif
resource_type
==
ResourceType
.
element
:
response
=
item
.
serialize
(
keys
,
self
.
_legacy_mode
,
HTTP_GET
)
status
=
200
logger
.
info
(
'
Response: {}
'
.
format
(
response
))
except
(
DeviceException
,
ServerException
,
UserException
)
as
e
:
...
...
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