Skip to content

Commit 440d125

Browse files
committed
pylint fixes
1 parent 3f75f99 commit 440d125

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

opcua/common/structures_generator.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,22 @@
44
for custom structures
55
"""
66

7-
from lxml import etree
87
from lxml import objectify
98

109

11-
1210
from opcua.ua.ua_binary import Primitives
1311

1412

1513
def get_default_value(uatype):
16-
if uatype in ("String"):
14+
if uatype == "String":
1715
return "None"
1816
elif uatype == "Guid":
1917
return "uuid.uuid4()"
2018
elif uatype in ("ByteString", "CharArray", "Char"):
2119
return None
22-
elif uatype in ("Boolean"):
20+
elif uatype == "Boolean":
2321
return "True"
24-
elif uatype in ("DateTime"):
22+
elif uatype == "DateTime":
2523
return "datetime.utcnow()"
2624
elif uatype in ("Int8", "Int16", "Int32", "Int64", "UInt8", "UInt16", "UInt32", "UInt64", "Double", "Float", "Byte", "SByte"):
2725
return 0
@@ -100,7 +98,7 @@ def to_binary(self):
10098
packet.append(ua.ua_binary.Primitives.Int32.pack(len(self.{0})))
10199
for element in self.{0}:
102100
packet.append(element.to_binary())
103-
'''.format(field.name, field.uatype)
101+
'''.format(field.name)
104102
else:
105103
self.code += " packet.append(self.{}.to_binary())\n".format(field.name)
106104
self.code += ' return b"".join(packet)'
@@ -119,6 +117,7 @@ def __init__(self, path, output):
119117
self.path = path
120118
self.output = output
121119
self.model = []
120+
self._file = None
122121

123122
def _make_model(self):
124123
obj = objectify.parse(self.path)

0 commit comments

Comments
 (0)