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
GitLab 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
45aea013
Commit
45aea013
authored
Mar 14, 2023
by
Matthias Stefan Bodenbenner
Browse files
Options
Downloads
Patches
Plain Diff
changed initalization procedure, made it much more easy
parent
71609a1c
No related branches found
No related tags found
No related merge requests found
Pipeline
#245518
passed
Mar 14, 2023
Stage: build
Stage: deploy
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+5
-1
5 additions, 1 deletion
README.md
setup.py
+1
-1
1 addition, 1 deletion
setup.py
src/http/server.py
+2
-5
2 additions, 5 deletions
src/http/server.py
src/soil/component.py
+2
-2
2 additions, 2 deletions
src/soil/component.py
with
10 additions
and
9 deletions
README.md
+
5
−
1
View file @
45aea013
[

](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/commits/master)
[

](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/commits/master)
# Python Unified Device Interface
# Python Unified Device Interface
Current stable version: 8.0.
0
Current stable version: 8.0.
1
Stable legacy version: 5.2.7
**SHOULD NOT BE USED ANYMORE!**
Stable legacy version: 5.2.7
**SHOULD NOT BE USED ANYMORE!**
## Installation
## Installation
...
@@ -65,6 +65,10 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
...
@@ -65,6 +65,10 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
## Recent changes
## Recent changes
**8.0.1**
- 2023-03-14
-
bug fixes
-
fixed DELETE endpoint for dynamic components
**8.0.0**
- 2023-03-11
**8.0.0**
- 2023-03-11
-
changed initialization routine
-
changed initialization routine
-
the mapping via a dictionary of encapsulated sensor logic to HTTP-Endpoints is not needed anymore
-
the mapping via a dictionary of encapsulated sensor logic to HTTP-Endpoints is not needed anymore
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
45aea013
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
setup
(
name
=
'
wzl-udi
'
,
setup
(
name
=
'
wzl-udi
'
,
version
=
'
8.0.
0
'
,
version
=
'
8.0.
1
'
,
url
=
'
https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python
'
,
url
=
'
https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python
'
,
author
=
'
Matthias Bodenbenner
'
,
author
=
'
Matthias Bodenbenner
'
,
author_email
=
'
m.bodenbenner@wzl.mq.rwth-aachen.de
'
,
author_email
=
'
m.bodenbenner@wzl.mq.rwth-aachen.de
'
,
...
...
This diff is collapsed.
Click to expand it.
src/http/server.py
+
2
−
5
View file @
45aea013
...
@@ -192,9 +192,8 @@ class HTTPServer(object):
...
@@ -192,9 +192,8 @@ class HTTPServer(object):
return
self
.
prepare_response
(
response
,
item
,
status
=
status
)
return
self
.
prepare_response
(
response
,
item
,
status
=
status
)
async
def
delete
(
self
,
request
):
async
def
delete
(
self
,
request
):
logger
.
info
(
"
PUT
Request from {}
"
.
format
(
request
.
url
))
logger
.
info
(
"
DELETE
Request from {}
"
.
format
(
request
.
url
))
logger
.
debug
(
'
Request: {}
'
.
format
(
request
))
logger
.
debug
(
'
Request: {}
'
.
format
(
request
))
data
=
await
request
.
json
()
uuids
=
HTTPServer
.
parse_uuids
(
request
)
uuids
=
HTTPServer
.
parse_uuids
(
request
)
try
:
try
:
...
@@ -208,9 +207,7 @@ class HTTPServer(object):
...
@@ -208,9 +207,7 @@ class HTTPServer(object):
if
not
isinstance
(
item
,
Component
):
if
not
isinstance
(
item
,
Component
):
return
self
.
prepare_response
({},
None
,
status
=
405
)
return
self
.
prepare_response
({},
None
,
status
=
405
)
try
:
try
:
component_name
=
await
self
.
loop
.
run_in_executor
(
None
,
component_name
=
await
self
.
loop
.
run_in_executor
(
None
,
functools
.
partial
(
item
.
remove
,
uuids
[
-
1
]))
functools
.
partial
(
item
.
remove
,
uuids
[
-
1
],
*
data
[
'
args
'
],
**
data
[
'
kwargs
'
]))
if
self
.
_scheduler
is
not
None
:
if
self
.
_scheduler
is
not
None
:
self
.
_scheduler
.
remove_jobs
(
'
/
'
.
join
(
uuids
))
self
.
_scheduler
.
remove_jobs
(
'
/
'
.
join
(
uuids
))
...
...
This diff is collapsed.
Click to expand it.
src/soil/component.py
+
2
−
2
View file @
45aea013
...
@@ -342,11 +342,11 @@ class Component(Element):
...
@@ -342,11 +342,11 @@ class Component(Element):
else
:
else
:
raise
UserException
(
'
UUID {} is not of the UUID of an component.
'
.
format
(
uuid
))
raise
UserException
(
'
UUID {} is not of the UUID of an component.
'
.
format
(
uuid
))
def
remove
(
self
,
uuid
:
str
,
*
args
,
**
kwargs
)
->
str
:
def
remove
(
self
,
uuid
:
str
)
->
str
:
for
o
in
self
.
_components
:
for
o
in
self
.
_components
:
if
o
.
uuid
==
uuid
:
if
o
.
uuid
==
uuid
:
try
:
try
:
getattr
(
self
.
_implementation
,
'
remove
'
)(
*
args
,
**
kwargs
)
getattr
(
self
.
_implementation
,
'
remove
'
)(
uuid
)
except
Exception
as
e
:
except
Exception
as
e
:
raise
DeviceException
(
str
(
e
),
predecessor
=
e
)
raise
DeviceException
(
str
(
e
),
predecessor
=
e
)
self
.
_components
.
remove
(
o
)
self
.
_components
.
remove
(
o
)
...
...
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