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
b06f1047
Commit
b06f1047
authored
Feb 26, 2021
by
oroulet
Committed by
oroulet
Mar 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint
parent
ea611693
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
18 deletions
+12
-18
asyncua/client/client.py
asyncua/client/client.py
+1
-2
asyncua/common/structures104.py
asyncua/common/structures104.py
+7
-7
asyncua/common/utils.py
asyncua/common/utils.py
+1
-0
asyncua/common/xmlparser.py
asyncua/common/xmlparser.py
+0
-1
asyncua/sync.py
asyncua/sync.py
+1
-1
asyncua/ua/ua_binary.py
asyncua/ua/ua_binary.py
+1
-1
asyncua/ua/uatypes.py
asyncua/ua/uatypes.py
+1
-6
No files found.
asyncua/client/client.py
View file @
b06f1047
...
...
@@ -678,7 +678,7 @@ class Client:
get_values
=
read_values
# legacy compatibility
set_values
=
write_values
# legacy compatibility
async
def
browse_nodes
(
self
,
nodes
):
"""
Browses multiple nodes in one ua call
...
...
@@ -696,4 +696,3 @@ class Client:
parameters
.
NodesToBrowse
=
nodestobrowse
results
=
await
self
.
uaclient
.
browse
(
parameters
)
return
list
(
zip
(
nodes
,
results
))
asyncua/common/structures104.py
View file @
b06f1047
...
...
@@ -70,8 +70,8 @@ async def new_struct(
sdef
=
ua
.
StructureDefinition
()
sdef
.
StructureType
=
ua
.
StructureType
.
Structure
for
field
in
fields
:
if
field
.
IsOptional
:
for
s
field
in
fields
:
if
s
field
.
IsOptional
:
sdef
.
StructureType
=
ua
.
StructureType
.
StructureWithOptionalFields
break
sdef
.
Fields
=
fields
...
...
@@ -269,8 +269,8 @@ async def _recursive_parse(server, base_node, dtypes, parent_sdef=None):
continue
name = clean_name(desc.BrowseName.Name)
if parent_sdef:
for field in reversed(parent_sdef.Fields):
sdef.Fields.insert(0, field)
for
s
field in reversed(parent_sdef.Fields):
sdef.Fields.insert(0,
s
field)
dtypes.append(DataTypeSorter(desc.NodeId, name, desc, sdef))
await _recursive_parse(server, server.get_node(desc.NodeId), dtypes, parent_sdef=sdef)
...
...
@@ -324,9 +324,9 @@ class {name}(IntEnum):
"""
for field in edef.Fields:
name = clean_name(field.Name)
value = field.Value
for
s
field in edef.Fields:
name = clean_name(
s
field.Name)
value =
s
field.Value
code += f" {name} = {value}
\
n
"
return code
...
...
asyncua/common/utils.py
View file @
b06f1047
...
...
@@ -90,5 +90,6 @@ class Buffer:
self
.
_cur_pos
=
cur_pos
self
.
_size
=
len
(
self
.
_data
)
-
cur_pos
def
create_nonce
(
size
=
32
):
return
os
.
urandom
(
size
)
asyncua/common/xmlparser.py
View file @
b06f1047
...
...
@@ -403,4 +403,3 @@ class XMLParser:
# check if ModelUri X, in Version Y from time Z was already imported
required_models
.
append
(
child
.
attrib
)
return
required_models
asyncua/sync.py
View file @
b06f1047
...
...
@@ -501,7 +501,7 @@ class SyncNode:
def
read_data_type_as_variant_type
(
self
):
pass
get_data_type_as_variant_type
=
read_data_type_as_variant_type
#legacy
get_data_type_as_variant_type
=
read_data_type_as_variant_type
#
legacy
@
syncmethod
def
call_method
(
self
,
methodid
,
*
args
):
...
...
asyncua/ua/ua_binary.py
View file @
b06f1047
...
...
@@ -258,7 +258,7 @@ def to_binary(uatype, val):
Pack a python object to binary given a type hint
"""
if
type_is_list
(
uatype
):
return
list_to_binary
(
_from_list
(
uatype
),
val
)
return
list_to_binary
(
type
_from_list
(
uatype
),
val
)
if
hasattr
(
Primitives
,
uatype
.
__name__
):
return
getattr
(
Primitives
,
uatype
.
__name__
).
pack
(
val
)
if
isinstance
(
val
,
(
IntEnum
,
Enum
)):
...
...
asyncua/ua/uatypes.py
View file @
b06f1047
...
...
@@ -417,7 +417,7 @@ class NodeId:
def
__lt__
(
self
,
other
):
if
not
isinstance
(
other
,
NodeId
):
raise
AttributeError
(
"Can only compare to NodeId"
)
print
(
self
.
NodeIdType
,
self
.
NamespaceIndex
,
self
.
Identifier
,
other
.
NodeIdType
,
other
.
NamespaceIndex
,
other
.
Identifier
)
print
(
self
.
NodeIdType
,
self
.
NamespaceIndex
,
self
.
Identifier
,
other
.
NodeIdType
,
other
.
NamespaceIndex
,
other
.
Identifier
)
return
(
self
.
NodeIdType
,
self
.
NamespaceIndex
,
self
.
Identifier
)
<
(
other
.
NodeIdType
,
other
.
NamespaceIndex
,
other
.
Identifier
)
def
is_null
(
self
):
...
...
@@ -871,11 +871,6 @@ class Variant:
)
def _split_list(l, n):
n = max(1, n)
return [l[i : i + n] for i in range(0, len(l), n)]
def flatten_and_get_shape(mylist):
dims = [len(mylist)]
while isinstance(mylist[0], (list, tuple)):
...
...
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