本文整理汇总了Python中pyon.core.bootstrap.IonObject.reason方法的典型用法代码示例。如果您正苦于以下问题:Python IonObject.reason方法的具体用法?Python IonObject.reason怎么用?Python IonObject.reason使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.core.bootstrap.IonObject
的用法示例。
在下文中一共展示了IonObject.reason方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: obtain_agent_calculation
# 需要导入模块: from pyon.core.bootstrap import IonObject [as 别名]
# 或者: from pyon.core.bootstrap.IonObject import reason [as 别名]
def obtain_agent_calculation(self, device_id, result_container):
ret = IonObject(result_container)
h_agent, reason = self.get_device_agent(device_id)
if None is h_agent:
ret.status = ComputedValueAvailability.NOTAVAILABLE
ret.reason = reason
else:
ret.status = ComputedValueAvailability.PROVIDED
return h_agent, ret
示例2: obtain_agent_calculation
# 需要导入模块: from pyon.core.bootstrap import IonObject [as 别名]
# 或者: from pyon.core.bootstrap.IonObject import reason [as 别名]
def obtain_agent_calculation(self, device_id, result_container):
ret = IonObject(result_container)
a_client = None
try:
a_client = self.obtain_agent_handle(device_id)
ret.status = ComputedValueAvailability.PROVIDED
except NotFound:
ret.status = ComputedValueAvailability.NOTAVAILABLE
ret.reason = "Could not connect to instrument agent instance -- may not be running"
except Exception as e:
raise e
return a_client, ret