threaded_item.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Parlay 作者: PromenadeSoftware 项目源码 文件源码
def get_all_items_with_name(self, item_name):
        """
        Returns a handler object that can be used to send messages to an item.

        :param item_name: globally unique name of the item
        :return: a proxy object for the item
        """

        if not self._reactor.running:
            raise Exception("You must call parlay.utils.setup() at the beginning of a script!")

        result = [self._proxy_item(x) for x in self._find_item_info(self.discovery, item_name, "NAME")]
        if len(result) == 0:  # retry after discover if it fails
            yield self.discover(force=False)
            result = [self._proxy_item(x) for x in self._find_item_info(self.discovery, item_name, "NAME")]

        defer.returnValue(result)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号