Code Duplication    Length = 29-31 lines in 5 locations

opcua/ua/uaprotocol_auto.py 5 locations

@@ 12430-12460 (lines=31) @@
12427
12428
    __repr__ = __str__
12429
12430
12431
class DeleteSubscriptionsParameters(FrozenClass):
12432
    '''
12433
    :ivar SubscriptionIds:
12434
    :vartype SubscriptionIds: UInt32
12435
    '''
12436
    def __init__(self, binary=None):
12437
        if binary is not None:
12438
            self._binary_init(binary)
12439
            self._freeze = True
12440
            return
12441
        self.SubscriptionIds = []
12442
        self._freeze = True
12443
12444
    def to_binary(self):
12445
        packet = []
12446
        packet.append(uatype_Int32.pack(len(self.SubscriptionIds)))
12447
        for fieldname in self.SubscriptionIds:
12448
            packet.append(uatype_UInt32.pack(fieldname))
12449
        return b''.join(packet)
12450
12451
    @staticmethod
12452
    def from_binary(data):
12453
        return DeleteSubscriptionsParameters(data)
12454
12455
    def _binary_init(self, data):
12456
        self.SubscriptionIds = unpack_uatype_array('UInt32', data)
12457
12458
    def __str__(self):
12459
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
12460
12461
    __repr__ = __str__
12462
12463
@@ 6969-6997 (lines=29) @@
6966
6967
    __repr__ = __str__
6968
6969
6970
class ElementOperand(FrozenClass):
6971
    '''
6972
    :ivar Index:
6973
    :vartype Index: UInt32
6974
    '''
6975
    def __init__(self, binary=None):
6976
        if binary is not None:
6977
            self._binary_init(binary)
6978
            self._freeze = True
6979
            return
6980
        self.Index = 0
6981
        self._freeze = True
6982
6983
    def to_binary(self):
6984
        packet = []
6985
        packet.append(uatype_UInt32.pack(self.Index))
6986
        return b''.join(packet)
6987
6988
    @staticmethod
6989
    def from_binary(data):
6990
        return ElementOperand(data)
6991
6992
    def _binary_init(self, data):
6993
        self.Index = uatype_UInt32.unpack(data.read(4))[0]
6994
6995
    def __str__(self):
6996
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
6997
6998
    __repr__ = __str__
6999
7000
@@ 3644-3672 (lines=29) @@
3641
3642
    __repr__ = __str__
3643
3644
3645
class CancelResult(FrozenClass):
3646
    '''
3647
    :ivar CancelCount:
3648
    :vartype CancelCount: UInt32
3649
    '''
3650
    def __init__(self, binary=None):
3651
        if binary is not None:
3652
            self._binary_init(binary)
3653
            self._freeze = True
3654
            return
3655
        self.CancelCount = 0
3656
        self._freeze = True
3657
3658
    def to_binary(self):
3659
        packet = []
3660
        packet.append(uatype_UInt32.pack(self.CancelCount))
3661
        return b''.join(packet)
3662
3663
    @staticmethod
3664
    def from_binary(data):
3665
        return CancelResult(data)
3666
3667
    def _binary_init(self, data):
3668
        self.CancelCount = uatype_UInt32.unpack(data.read(4))[0]
3669
3670
    def __str__(self):
3671
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
3672
3673
    __repr__ = __str__
3674
3675
@@ 3568-3596 (lines=29) @@
3565
3566
    __repr__ = __str__
3567
3568
3569
class CancelParameters(FrozenClass):
3570
    '''
3571
    :ivar RequestHandle:
3572
    :vartype RequestHandle: UInt32
3573
    '''
3574
    def __init__(self, binary=None):
3575
        if binary is not None:
3576
            self._binary_init(binary)
3577
            self._freeze = True
3578
            return
3579
        self.RequestHandle = 0
3580
        self._freeze = True
3581
3582
    def to_binary(self):
3583
        packet = []
3584
        packet.append(uatype_UInt32.pack(self.RequestHandle))
3585
        return b''.join(packet)
3586
3587
    @staticmethod
3588
    def from_binary(data):
3589
        return CancelParameters(data)
3590
3591
    def _binary_init(self, data):
3592
        self.RequestHandle = uatype_UInt32.unpack(data.read(4))[0]
3593
3594
    def __str__(self):
3595
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
3596
3597
    __repr__ = __str__
3598
3599
@@ 12673-12703 (lines=31) @@
12670
12671
    __repr__ = __str__
12672
12673
12674
class EndpointUrlListDataType(FrozenClass):
12675
    '''
12676
    :ivar EndpointUrlList:
12677
    :vartype EndpointUrlList: String
12678
    '''
12679
    def __init__(self, binary=None):
12680
        if binary is not None:
12681
            self._binary_init(binary)
12682
            self._freeze = True
12683
            return
12684
        self.EndpointUrlList = []
12685
        self._freeze = True
12686
12687
    def to_binary(self):
12688
        packet = []
12689
        packet.append(uatype_Int32.pack(len(self.EndpointUrlList)))
12690
        for fieldname in self.EndpointUrlList:
12691
            packet.append(pack_string(fieldname))
12692
        return b''.join(packet)
12693
12694
    @staticmethod
12695
    def from_binary(data):
12696
        return EndpointUrlListDataType(data)
12697
12698
    def _binary_init(self, data):
12699
        self.EndpointUrlList = unpack_uatype_array('String', data)
12700
12701
    def __str__(self):
12702
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
12703
12704
    __repr__ = __str__
12705
12706