Code Duplication    Length = 28-28 lines in 3 locations

opcua/ua/uaprotocol_auto.py 3 locations

@@ 6260-6287 (lines=28) @@
6257
    '''
6258
6259
    ua_types = [
6260
        ('NodeId', 'NodeId'),
6261
        ('BrowseDirection', 'BrowseDirection'),
6262
        ('ReferenceTypeId', 'NodeId'),
6263
        ('IncludeSubtypes', 'Boolean'),
6264
        ('NodeClassMask', 'UInt32'),
6265
        ('ResultMask', 'UInt32'),
6266
               ]
6267
6268
    def __init__(self):
6269
        self.NodeId = NodeId()
6270
        self.BrowseDirection = BrowseDirection(0)
6271
        self.ReferenceTypeId = NodeId()
6272
        self.IncludeSubtypes = True
6273
        self.NodeClassMask = 0
6274
        self.ResultMask = 0
6275
        self._freeze = True
6276
6277
    def __str__(self):
6278
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6279
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
6280
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6281
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6282
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
6283
               'ResultMask:' + str(self.ResultMask) + ')'
6284
6285
    __repr__ = __str__
6286
6287
6288
class ReferenceDescription(FrozenClass):
6289
    '''
6290
    The description of a reference.
@@ 5114-5141 (lines=28) @@
5111
               'WriteMask:' + str(self.WriteMask) + ', ' + \
5112
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
5113
5114
    __repr__ = __str__
5115
5116
5117
class ObjectAttributes(FrozenClass):
5118
    '''
5119
    The attributes for an object node.
5120
5121
    :ivar SpecifiedAttributes:
5122
    :vartype SpecifiedAttributes: UInt32
5123
    :ivar DisplayName:
5124
    :vartype DisplayName: LocalizedText
5125
    :ivar Description:
5126
    :vartype Description: LocalizedText
5127
    :ivar WriteMask:
5128
    :vartype WriteMask: UInt32
5129
    :ivar UserWriteMask:
5130
    :vartype UserWriteMask: UInt32
5131
    :ivar EventNotifier:
5132
    :vartype EventNotifier: Byte
5133
    '''
5134
5135
    ua_types = [
5136
        ('SpecifiedAttributes', 'UInt32'),
5137
        ('DisplayName', 'LocalizedText'),
5138
        ('Description', 'LocalizedText'),
5139
        ('WriteMask', 'UInt32'),
5140
        ('UserWriteMask', 'UInt32'),
5141
        ('EventNotifier', 'Byte'),
5142
               ]
5143
5144
    def __init__(self):
@@ 5059-5086 (lines=28) @@
5056
        ('TypeId', 'NodeId'),
5057
        ('ResponseHeader', 'ResponseHeader'),
5058
        ('Parameters', 'CancelResult'),
5059
               ]
5060
5061
    def __init__(self):
5062
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
5063
        self.ResponseHeader = ResponseHeader()
5064
        self.Parameters = CancelResult()
5065
        self._freeze = True
5066
5067
    def __str__(self):
5068
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5069
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5070
               'Parameters:' + str(self.Parameters) + ')'
5071
5072
    __repr__ = __str__
5073
5074
5075
class NodeAttributes(FrozenClass):
5076
    '''
5077
    The base attributes for all nodes.
5078
5079
    :ivar SpecifiedAttributes:
5080
    :vartype SpecifiedAttributes: UInt32
5081
    :ivar DisplayName:
5082
    :vartype DisplayName: LocalizedText
5083
    :ivar Description:
5084
    :vartype Description: LocalizedText
5085
    :ivar WriteMask:
5086
    :vartype WriteMask: UInt32
5087
    :ivar UserWriteMask:
5088
    :vartype UserWriteMask: UInt32
5089
    '''