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
cc33ac45
Commit
cc33ac45
authored
Mar 30, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create_* allow to have either a string or nodeid/qualifiedname for bothr args
parent
8885d865
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
opcua/common/manage_nodes.py
opcua/common/manage_nodes.py
+10
-6
No files found.
opcua/common/manage_nodes.py
View file @
cc33ac45
...
...
@@ -7,24 +7,28 @@ from opcua.common import node
def
_parse_add_args
(
*
args
):
try
:
if
isinstance
(
args
[
0
],
int
):
nodeid
=
ua
.
NodeId
(
0
,
int
(
args
[
0
]))
qname
=
ua
.
QualifiedName
(
args
[
1
],
int
(
args
[
0
]))
return
nodeid
,
qname
if
isinstance
(
args
[
0
],
ua
.
NodeId
):
nodeid
=
args
[
0
]
qname
=
args
[
1
]
elif
isinstance
(
args
[
0
],
str
):
nodeid
=
ua
.
NodeId
.
from_string
(
args
[
0
])
else
:
raise
RuntimeError
()
if
isinstance
(
args
[
1
],
ua
.
QualifiedName
):
qname
=
args
[
1
]
elif
isinstance
(
args
[
1
],
str
):
qname
=
ua
.
QualifiedName
.
from_string
(
args
[
1
])
elif
isinstance
(
args
[
0
],
int
):
nodeid
=
ua
.
NodeId
(
0
,
int
(
args
[
0
]))
qname
=
ua
.
QualifiedName
(
args
[
1
],
args
[
0
])
else
:
raise
RuntimeError
()
return
nodeid
,
qname
except
ua
.
UaError
:
raise
except
Exception
as
ex
:
raise
TypeError
(
"This method takes either a namespace index and a string as argument or a nodeid and a qualifiedname. Received arguments {} and got exception {}"
.
format
(
args
,
ex
))
return
nodeid
,
qname
def
create_folder
(
parent
,
*
args
):
"""
...
...
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