MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / EnumType

Class EnumType

opcua/common/structures.py:48–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48class EnumType(object):
49 def __init__(self, name):
50 self.name = name
51 self.fields = []
52 self.typeid = None
53
54 def get_code(self):
55 code = """
56
57class {0}(IntEnum):
58
59 '''
60 {0} EnumInt autogenerated from xml
61 '''
62
63""".format(self.name)
64
65 for EnumeratedValue in self.fields:
66 name = EnumeratedValue.Name
67 value = EnumeratedValue.Value
68 code += " {} = {}\n".format(name, value)
69
70 return code
71
72
73class EnumeratedValue(object):

Callers 3

_make_modelMethod · 0.85
_get_enum_valuesFunction · 0.85
_get_enum_stringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected