本文整理汇总了Python中cocaine.services.Service.connectThroughLocator方法的典型用法代码示例。如果您正苦于以下问题:Python Service.connectThroughLocator方法的具体用法?Python Service.connectThroughLocator怎么用?Python Service.connectThroughLocator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cocaine.services.Service
的用法示例。
在下文中一共展示了Service.connectThroughLocator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from cocaine.services import Service [as 别名]
# 或者: from cocaine.services.Service import connectThroughLocator [as 别名]
def execute(self):
appNames = yield self.node.list()
appInfoList = {}
for appName in appNames:
info = ''
try:
app = Service(appName, blockingConnect=False)
yield app.connectThroughLocator(self.locator)
info = yield app.info()
except Exception as err:
info = str(err)
finally:
appInfoList[appName] = info
result = {
'apps': appInfoList
}
yield result
示例2: info
# 需要导入模块: from cocaine.services import Service [as 别名]
# 或者: from cocaine.services.Service import connectThroughLocator [as 别名]
def info(self, apps):
infos = {}
for app_ in apps:
info = ''
try:
app = Service(app_, blockingConnect=False)
yield app.connectThroughLocator(self.locator)
info = yield app.info()
if all([self._expand, self._storage is not None, 'profile' in info]):
info['profile'] = yield profile.View(self._storage, info['profile']).execute()
except Exception as err:
info = str(err)
finally:
infos[app_] = info
result = {
'apps': infos
}
yield result