Code Duplication    Length = 47-49 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 3101-3149 (lines=49) @@
3098
3099
    __repr__ = __str__
3100
3101
3102
class UserNameIdentityToken(FrozenClass):
3103
    '''
3104
    A token representing a user identified by a user name and password.
3105
3106
    :ivar PolicyId:
3107
    :vartype PolicyId: String
3108
    :ivar UserName:
3109
    :vartype UserName: String
3110
    :ivar Password:
3111
    :vartype Password: ByteString
3112
    :ivar EncryptionAlgorithm:
3113
    :vartype EncryptionAlgorithm: String
3114
    '''
3115
    def __init__(self, binary=None):
3116
        if binary is not None:
3117
            self._binary_init(binary)
3118
            self._freeze = True
3119
            return
3120
        self.PolicyId = None
3121
        self.UserName = None
3122
        self.Password = None
3123
        self.EncryptionAlgorithm = None
3124
        self._freeze = True
3125
3126
    def to_binary(self):
3127
        packet = []
3128
        packet.append(pack_string(self.PolicyId))
3129
        packet.append(pack_string(self.UserName))
3130
        packet.append(pack_bytes(self.Password))
3131
        packet.append(pack_string(self.EncryptionAlgorithm))
3132
        return b''.join(packet)
3133
3134
    @staticmethod
3135
    def from_binary(data):
3136
        return UserNameIdentityToken(data)
3137
3138
    def _binary_init(self, data):
3139
        self.PolicyId = unpack_string(data)
3140
        self.UserName = unpack_string(data)
3141
        self.Password = unpack_bytes(data)
3142
        self.EncryptionAlgorithm = unpack_string(data)
3143
3144
    def __str__(self):
3145
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3146
               'UserName:' + str(self.UserName) + ', ' + \
3147
               'Password:' + str(self.Password) + ', ' + \
3148
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3149
3150
    __repr__ = __str__
3151
3152
@@ 7903-7949 (lines=47) @@
7900
7901
    __repr__ = __str__
7902
7903
7904
class HistoryReadValueId(FrozenClass):
7905
    '''
7906
    :ivar NodeId:
7907
    :vartype NodeId: NodeId
7908
    :ivar IndexRange:
7909
    :vartype IndexRange: String
7910
    :ivar DataEncoding:
7911
    :vartype DataEncoding: QualifiedName
7912
    :ivar ContinuationPoint:
7913
    :vartype ContinuationPoint: ByteString
7914
    '''
7915
    def __init__(self, binary=None):
7916
        if binary is not None:
7917
            self._binary_init(binary)
7918
            self._freeze = True
7919
            return
7920
        self.NodeId = NodeId()
7921
        self.IndexRange = None
7922
        self.DataEncoding = QualifiedName()
7923
        self.ContinuationPoint = None
7924
        self._freeze = True
7925
7926
    def to_binary(self):
7927
        packet = []
7928
        packet.append(self.NodeId.to_binary())
7929
        packet.append(pack_string(self.IndexRange))
7930
        packet.append(self.DataEncoding.to_binary())
7931
        packet.append(pack_bytes(self.ContinuationPoint))
7932
        return b''.join(packet)
7933
7934
    @staticmethod
7935
    def from_binary(data):
7936
        return HistoryReadValueId(data)
7937
7938
    def _binary_init(self, data):
7939
        self.NodeId = NodeId.from_binary(data)
7940
        self.IndexRange = unpack_string(data)
7941
        self.DataEncoding = QualifiedName.from_binary(data)
7942
        self.ContinuationPoint = unpack_bytes(data)
7943
7944
    def __str__(self):
7945
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7946
               'IndexRange:' + str(self.IndexRange) + ', ' + \
7947
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
7948
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
7949
7950
    __repr__ = __str__
7951
7952