当前位置: 首页>>代码示例>>Python>>正文


Python typecheck.is_enum函数代码示例

本文整理汇总了Python中raritan.rpc.typecheck.is_enum函数的典型用法代码示例。如果您正苦于以下问题:Python is_enum函数的具体用法?Python is_enum怎么用?Python is_enum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_enum函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: encode

 def encode(ctxName, logLevel):
     typecheck.is_string(ctxName, AssertionError)
     typecheck.is_enum(logLevel, raritan.rpc.diag.DiagLogSettings.LogLevel, AssertionError)
     args = {}
     args['ctxName'] = ctxName
     args['logLevel'] = raritan.rpc.diag.DiagLogSettings.LogLevel.encode(logLevel)
     return args
开发者ID:gsquire1,项目名称:automation,代码行数:7,代码来源:__init__.py

示例2: __init__

    def __init__(self, enabled, autocfg, ipaddr, netmask, gateway, hostname, dns_suffixes, override_dns, dns_ip_1, dns_ip_2, domain_name):
        typecheck.is_bool(enabled, AssertionError)
        typecheck.is_enum(autocfg, raritan.rpc.net.AutoConfigs, AssertionError)
        typecheck.is_string(ipaddr, AssertionError)
        typecheck.is_string(netmask, AssertionError)
        typecheck.is_string(gateway, AssertionError)
        typecheck.is_string(hostname, AssertionError)
        for x0 in dns_suffixes:
            typecheck.is_string(x0, AssertionError)
        typecheck.is_bool(override_dns, AssertionError)
        typecheck.is_string(dns_ip_1, AssertionError)
        typecheck.is_string(dns_ip_2, AssertionError)
        typecheck.is_string(domain_name, AssertionError)

        self.enabled = enabled
        self.autocfg = autocfg
        self.ipaddr = ipaddr
        self.netmask = netmask
        self.gateway = gateway
        self.hostname = hostname
        self.dns_suffixes = dns_suffixes
        self.override_dns = override_dns
        self.dns_ip_1 = dns_ip_1
        self.dns_ip_2 = dns_ip_2
        self.domain_name = domain_name
开发者ID:gsquire1,项目名称:Python,代码行数:25,代码来源:__init__.py

示例3: startUpdate

 def startUpdate(self, flags):
     agent = self.agent
     for x0 in flags:
         typecheck.is_enum(x0, raritan.rpc.firmware.UpdateFlags, AssertionError)
     args = {}
     args['flags'] = [raritan.rpc.firmware.UpdateFlags.encode(x0) for x0 in flags]
     rsp = agent.json_rpc(self.target, 'startUpdate', args)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:7,代码来源:__init__.py

示例4: getState

 def getState(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getState', args)
     _ret_ = raritan.rpc.hmi.ExternalBeeper.State.decode(rsp['_ret_'])
     typecheck.is_enum(_ret_, raritan.rpc.hmi.ExternalBeeper.State, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:7,代码来源:__init__.py

示例5: __init__

    def __init__(self, width, height, pixelFormat):
        typecheck.is_int(width, AssertionError)
        typecheck.is_int(height, AssertionError)
        typecheck.is_enum(pixelFormat, raritan.rpc.webcam.PixelFormat, AssertionError)

        self.width = width
        self.height = height
        self.pixelFormat = pixelFormat
开发者ID:gsquire1,项目名称:automation,代码行数:8,代码来源:__init__.py

示例6: closeSession

 def closeSession(self, token, reason):
     agent = self.agent
     typecheck.is_string(token, AssertionError)
     typecheck.is_enum(reason, raritan.rpc.session.SessionManager.CloseReason, AssertionError)
     args = {}
     args['token'] = token
     args['reason'] = raritan.rpc.session.SessionManager.CloseReason.encode(reason)
     rsp = agent.json_rpc(self.target, 'closeSession', args)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:8,代码来源:__init__.py

示例7: getSupportedStorageTypes

 def getSupportedStorageTypes(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getSupportedStorageTypes', args)
     _ret_ = [raritan.rpc.webcam.StorageManager.StorageType.decode(x0) for x0 in rsp['_ret_']]
     for x0 in _ret_:
         typecheck.is_enum(x0, raritan.rpc.webcam.StorageManager.StorageType, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:8,代码来源:__init__.py

示例8: encode

 def encode(refId, count, direction):
     typecheck.is_int(refId, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.logging.RangeDirection, AssertionError)
     args = {}
     args['refId'] = refId
     args['count'] = count
     args['direction'] = raritan.rpc.logging.RangeDirection.encode(direction)
     return args
开发者ID:gsquire1,项目名称:Python,代码行数:9,代码来源:__init__.py

示例9: getStatus

 def getStatus(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getStatus', args)
     status = raritan.rpc.bulkcfg.BulkConfiguration.Status.decode(rsp['status'])
     timeStamp = raritan.rpc.Time.decode(rsp['timeStamp'])
     typecheck.is_enum(status, raritan.rpc.bulkcfg.BulkConfiguration.Status, DecodeException)
     typecheck.is_time(timeStamp, DecodeException)
     return (status, timeStamp)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:9,代码来源:__init__.py

示例10: getType

 def getType(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getType', args)
     _ret_ = rsp['_ret_']
     type = raritan.rpc.cascading.Cascading.Type.decode(rsp['type'])
     typecheck.is_int(_ret_, DecodeException)
     typecheck.is_enum(type, raritan.rpc.cascading.Cascading.Type, DecodeException)
     return (_ret_, type)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:9,代码来源:__init__.py

示例11: setType

 def setType(self, type):
     agent = self.agent
     typecheck.is_enum(type, raritan.rpc.cascading.Cascading.Type, AssertionError)
     args = {}
     args['type'] = raritan.rpc.cascading.Cascading.Type.encode(type)
     rsp = agent.json_rpc(self.target, 'setType', args)
     _ret_ = rsp['_ret_']
     typecheck.is_int(_ret_, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:9,代码来源:__init__.py

示例12: setPowerState

 def setPowerState(self, state):
     agent = self.agent
     typecheck.is_enum(state, raritan.rpc.sensors.Sensor.OnOffState, AssertionError)
     args = {}
     args['state'] = raritan.rpc.sensors.Sensor.OnOffState.encode(state)
     rsp = agent.json_rpc(self.target, 'setPowerState', args)
     _ret_ = rsp['_ret_']
     typecheck.is_int(_ret_, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:9,代码来源:__init__.py

示例13: __init__

        def __init__(self, zoneCfg, protocol, deviceTime, ntpCfg):
            typecheck.is_struct(zoneCfg, raritan.rpc.datetime.DateTime.ZoneCfg, AssertionError)
            typecheck.is_enum(protocol, raritan.rpc.datetime.DateTime.Protocol, AssertionError)
            typecheck.is_time(deviceTime, AssertionError)
            typecheck.is_struct(ntpCfg, raritan.rpc.datetime.DateTime.NtpCfg, AssertionError)

            self.zoneCfg = zoneCfg
            self.protocol = protocol
            self.deviceTime = deviceTime
            self.ntpCfg = ntpCfg
开发者ID:gsquire1,项目名称:automation,代码行数:10,代码来源:__init__.py

示例14: encode

 def encode(webcam, start, count, direction):
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_long(start, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.webcam.StorageManager.Direction, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['start'] = start
     args['count'] = count
     args['direction'] = raritan.rpc.webcam.StorageManager.Direction.encode(direction)
     return args
开发者ID:gsquire1,项目名称:automation,代码行数:11,代码来源:__init__.py

示例15: __init__

    def __init__(self, state, error_message, time_started, size_total, size_done):
        typecheck.is_enum(state, raritan.rpc.firmware.ImageState, AssertionError)
        typecheck.is_string(error_message, AssertionError)
        typecheck.is_time(time_started, AssertionError)
        typecheck.is_int(size_total, AssertionError)
        typecheck.is_int(size_done, AssertionError)

        self.state = state
        self.error_message = error_message
        self.time_started = time_started
        self.size_total = size_total
        self.size_done = size_done
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:12,代码来源:__init__.py


注:本文中的raritan.rpc.typecheck.is_enum函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。