Code Duplication    Length = 50-55 lines in 2 locations

opcua/ua/uaprotocol_auto.py 2 locations

@@ 1581-1635 (lines=55) @@
1578
1579
1580
class RegisteredServer(FrozenClass):
1581
    '''
1582
    The information required to register a server with a discovery server.
1583
1584
    :ivar ServerUri:
1585
    :vartype ServerUri: String
1586
    :ivar ProductUri:
1587
    :vartype ProductUri: String
1588
    :ivar ServerNames:
1589
    :vartype ServerNames: LocalizedText
1590
    :ivar ServerType:
1591
    :vartype ServerType: ApplicationType
1592
    :ivar GatewayServerUri:
1593
    :vartype GatewayServerUri: String
1594
    :ivar DiscoveryUrls:
1595
    :vartype DiscoveryUrls: String
1596
    :ivar SemaphoreFilePath:
1597
    :vartype SemaphoreFilePath: String
1598
    :ivar IsOnline:
1599
    :vartype IsOnline: Boolean
1600
    '''
1601
1602
    ua_types = [
1603
        ('ServerUri', 'String'),
1604
        ('ProductUri', 'String'),
1605
        ('ServerNames', 'ListOfLocalizedText'),
1606
        ('ServerType', 'ApplicationType'),
1607
        ('GatewayServerUri', 'String'),
1608
        ('DiscoveryUrls', 'ListOfString'),
1609
        ('SemaphoreFilePath', 'String'),
1610
        ('IsOnline', 'Boolean'),
1611
               ]
1612
1613
    def __init__(self):
1614
        self.ServerUri = None
1615
        self.ProductUri = None
1616
        self.ServerNames = []
1617
        self.ServerType = ApplicationType(0)
1618
        self.GatewayServerUri = None
1619
        self.DiscoveryUrls = []
1620
        self.SemaphoreFilePath = None
1621
        self.IsOnline = True
1622
        self._freeze = True
1623
1624
    def __str__(self):
1625
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
1626
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1627
               'ServerNames:' + str(self.ServerNames) + ', ' + \
1628
               'ServerType:' + str(self.ServerType) + ', ' + \
1629
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1630
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
1631
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
1632
               'IsOnline:' + str(self.IsOnline) + ')'
1633
1634
    __repr__ = __str__
1635
1636
1637
class RegisterServerRequest(FrozenClass):
1638
    '''
@@ 966-1015 (lines=50) @@
963
964
965
class ApplicationDescription(FrozenClass):
966
    '''
967
    Describes an application and how to find it.
968
969
    :ivar ApplicationUri:
970
    :vartype ApplicationUri: String
971
    :ivar ProductUri:
972
    :vartype ProductUri: String
973
    :ivar ApplicationName:
974
    :vartype ApplicationName: LocalizedText
975
    :ivar ApplicationType:
976
    :vartype ApplicationType: ApplicationType
977
    :ivar GatewayServerUri:
978
    :vartype GatewayServerUri: String
979
    :ivar DiscoveryProfileUri:
980
    :vartype DiscoveryProfileUri: String
981
    :ivar DiscoveryUrls:
982
    :vartype DiscoveryUrls: String
983
    '''
984
985
    ua_types = [
986
        ('ApplicationUri', 'String'),
987
        ('ProductUri', 'String'),
988
        ('ApplicationName', 'LocalizedText'),
989
        ('ApplicationType', 'ApplicationType'),
990
        ('GatewayServerUri', 'String'),
991
        ('DiscoveryProfileUri', 'String'),
992
        ('DiscoveryUrls', 'ListOfString'),
993
               ]
994
995
    def __init__(self):
996
        self.ApplicationUri = None
997
        self.ProductUri = None
998
        self.ApplicationName = LocalizedText()
999
        self.ApplicationType = ApplicationType(0)
1000
        self.GatewayServerUri = None
1001
        self.DiscoveryProfileUri = None
1002
        self.DiscoveryUrls = []
1003
        self._freeze = True
1004
1005
    def __str__(self):
1006
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1007
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1008
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1009
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1010
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1011
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1012
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1013
1014
    __repr__ = __str__
1015
1016
1017
class RequestHeader(FrozenClass):
1018
    '''