Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
4fb0d26b
Commit
4fb0d26b
authored
Mar 26, 2021
by
oroulet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print autogenerated code if execution fails
parent
34a4ea5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
asyncua/common/structures.py
asyncua/common/structures.py
+6
-1
asyncua/common/structures104.py
asyncua/common/structures104.py
+5
-1
No files found.
asyncua/common/structures.py
View file @
4fb0d26b
...
...
@@ -89,6 +89,7 @@ class {self.name}:
if
uatype
==
'List[ua.Char]'
:
uatype
=
'String'
code
+=
f"
{
sfield
.
name
}
:
{
uatype
}
=
{
sfield
.
value
}\
n
"
print
(
code
)
return
code
...
...
@@ -276,7 +277,11 @@ def _generate_python_class(model, env=None):
# generate classes one by one and add them to dict
for
element
in
model
:
code
=
element
.
get_code
()
exec
(
code
,
env
)
try
:
exec
(
code
,
env
)
except
Exception
:
_logger
.
exception
(
"Failed to execute auto-generated code from UA datatype: %s"
,
code
)
raise
return
env
...
...
asyncua/common/structures104.py
View file @
4fb0d26b
...
...
@@ -235,7 +235,11 @@ async def _generate_object(name, sdef, data_type=None, env=None, enum=False):
else:
code = make_structure_code(data_type, name, sdef)
logger.debug("Executing code: %s", code)
exec(code, env)
try:
exec(code, env)
except Exception:
logger.exception("Failed to execute auto-generated code from UA datatype: %s", code)
raise
return env
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment