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


Python IonObject.reason方法代码示例

本文整理汇总了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
开发者ID:oldpatricka,项目名称:coi-services,代码行数:13,代码来源:status_builder.py

示例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
开发者ID:jamie-cyber1,项目名称:coi-services,代码行数:15,代码来源:status_builder.py


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