Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Insights
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
LOFAR2.0
tango
Commits
7d562f8a
Commit
7d562f8a
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-412
: Cleanup duplication of comments and logging.
parent
1e5ee8c2
No related branches found
No related tags found
1 merge request
!142
L2SS-412: Use asyncio for opcua and other clients
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/clients/attribute_wrapper.py
+1
-6
1 addition, 6 deletions
devices/clients/attribute_wrapper.py
with
1 addition
and
6 deletions
devices/clients/attribute_wrapper.py
+
1
−
6
View file @
7d562f8a
...
@@ -154,20 +154,15 @@ class attribute_wrapper(attribute):
...
@@ -154,20 +154,15 @@ class attribute_wrapper(attribute):
try
:
try
:
self
.
read_function
,
self
.
write_function
=
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
self
.
read_function
,
self
.
write_function
=
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
"
Exception while setting {} attribute with annotation:
'
{}
'
{}
"
.
format
(
client
.
__class__
.
__name__
,
self
.
comms_annotation
,
e
))
raise
Exception
(
"
Exception while setting %s attribute with annotation:
'
%s
'"
,
client
.
__class__
.
__name__
,
self
.
comms_annotation
)
from
e
raise
Exception
(
"
Exception while setting %s attribute with annotation:
'
%s
'"
,
client
.
__class__
.
__name__
,
self
.
comms_annotation
)
from
e
async
def
async_set_comm_client
(
self
,
client
):
async
def
async_set_comm_client
(
self
,
client
):
"""
"""
takes a communications client as input arguments This client should be of a class containing a
"
get_mapping
"
function
Asynchronous version of set_comm_client.
and return a read and write function that the wrapper will use to get/set data.
"""
"""
try
:
try
:
self
.
read_function
,
self
.
write_function
=
await
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
self
.
read_function
,
self
.
write_function
=
await
client
.
setup_attribute
(
self
.
comms_annotation
,
self
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
"
Exception while setting {} attribute with annotation:
'
{}
'
{}
"
.
format
(
client
.
__class__
.
__name__
,
self
.
comms_annotation
,
e
))
raise
Exception
(
"
Exception while setting %s attribute with annotation:
'
%s
'"
,
client
.
__class__
.
__name__
,
self
.
comms_annotation
)
from
e
raise
Exception
(
"
Exception while setting %s attribute with annotation:
'
%s
'"
,
client
.
__class__
.
__name__
,
self
.
comms_annotation
)
from
e
def
set_pass_func
(
self
):
def
set_pass_func
(
self
):
...
...
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