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


Python Interface.encode方法代码示例

本文整理汇总了Python中raritan.rpc.Interface.encode方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.encode方法的具体用法?Python Interface.encode怎么用?Python Interface.encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在raritan.rpc.Interface的用法示例。


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

示例1: encode

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def encode(self):
     json = {}
     json['l1'] = Interface.encode(self.l1)
     json['l2'] = Interface.encode(self.l2)
     json['l3'] = Interface.encode(self.l3)
     json['total'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.total)
     return json
开发者ID:gsquire1,项目名称:Python,代码行数:9,代码来源:__init__.py

示例2: encode

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def encode(webcam, image):
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_struct(image, raritan.rpc.webcam.Image, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['image'] = raritan.rpc.webcam.Image.encode(image)
     return args
开发者ID:gsquire1,项目名称:automation,代码行数:9,代码来源:__init__.py

示例3: stopActivity

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def stopActivity(self, webcam):
     agent = self.agent
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     rsp = agent.json_rpc(self.target, 'stopActivity', args)
     _ret_ = rsp['_ret_']
     typecheck.is_int(_ret_, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:11,代码来源:__init__.py

示例4: addImage

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def addImage(self, webcam, image):
     agent = self.agent
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_struct(image, raritan.rpc.webcam.Image, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['image'] = raritan.rpc.webcam.Image.encode(image)
     rsp = agent.json_rpc(self.target, 'addImage', args)
     _ret_ = rsp['_ret_']
     index = long(rsp['index'])
     typecheck.is_int(_ret_, DecodeException)
     typecheck.is_long(index, DecodeException)
     return (_ret_, index)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:15,代码来源:__init__.py

示例5: getChannel

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def getChannel(self, webcam, clientType):
     agent = self.agent
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_string(clientType, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['clientType'] = clientType
     rsp = agent.json_rpc(self.target, 'getChannel', args)
     _ret_ = rsp['_ret_']
     channel = Interface.decode(rsp['channel'], agent)
     typecheck.is_int(_ret_, DecodeException)
     typecheck.is_interface(channel, raritan.rpc.webcam.Channel, DecodeException)
     return (_ret_, channel)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:15,代码来源:__init__.py

示例6: startActivity

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def startActivity(self, webcam, count, interval):
     agent = self.agent
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_int(interval, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['count'] = count
     args['interval'] = interval
     rsp = agent.json_rpc(self.target, 'startActivity', args)
     _ret_ = rsp['_ret_']
     typecheck.is_int(_ret_, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:15,代码来源:__init__.py

示例7: removeImages

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def removeImages(self, webcam, start, count, direction):
     agent = self.agent
     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)
     rsp = agent.json_rpc(self.target, 'removeImages', args)
     _ret_ = rsp['_ret_']
     typecheck.is_int(_ret_, DecodeException)
     return _ret_
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:17,代码来源:__init__.py

示例8: getPeripheralDeviceTimedRecords

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def getPeripheralDeviceTimedRecords(self, slot, recid, count):
     agent = self.agent
     typecheck.is_interface(slot, raritan.rpc.peripheral.DeviceSlot, AssertionError)
     typecheck.is_int(recid, AssertionError)
     typecheck.is_int(count, AssertionError)
     args = {}
     args['slot'] = Interface.encode(slot)
     args['recid'] = recid
     args['count'] = count
     rsp = agent.json_rpc(self.target, 'getPeripheralDeviceTimedRecords', args)
     _ret_ = rsp['_ret_']
     recs = [raritan.rpc.sensors.Logger.TimedRecord.decode(x0, agent) for x0 in rsp['recs']]
     typecheck.is_int(_ret_, DecodeException)
     for x0 in recs:
         typecheck.is_struct(x0, raritan.rpc.sensors.Logger.TimedRecord, DecodeException)
     return (_ret_, recs)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:18,代码来源:__init__.py

示例9: getImages

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def getImages(self, webcam, start, count, direction):
     agent = self.agent
     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)
     rsp = agent.json_rpc(self.target, 'getImages', args)
     _ret_ = rsp['_ret_']
     image = [raritan.rpc.webcam.StorageManager.StorageImage.decode(x0, agent) for x0 in rsp['image']]
     typecheck.is_int(_ret_, DecodeException)
     for x0 in image:
         typecheck.is_struct(x0, raritan.rpc.webcam.StorageManager.StorageImage, DecodeException)
     return (_ret_, image)
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:20,代码来源:__init__.py

示例10: encode

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def encode(self):
     json = {}
     json['source'] = Interface.encode(self.source)
     return json
开发者ID:gsquire1,项目名称:automation,代码行数:6,代码来源:__init__.py

示例11: encode

# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
 def encode(self):
     json = {}
     json['sensors'] = [Interface.encode(x0) for x0 in self.sensors]
     json['slots'] = [Interface.encode(x0) for x0 in self.slots]
     return json
开发者ID:QualiSystems,项目名称:Raritan-PDU-Shell,代码行数:7,代码来源:__init__.py


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