コード例 #1
0
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     target = response.target_description
     return target_to_py(
         target=target,
         companion=CompanionInfo(address=self.address,
                                 udid=target.udid,
                                 is_local=self.is_local),
     )
コード例 #2
0
 async def describe(self, fetch_diagnostics: bool = False) -> TargetDescription:
     response = await self.stub.describe(
         TargetDescriptionRequest(fetch_diagnostics=fetch_diagnostics)
     )
     target = response.target_description
     return target_to_py(
         target=target,
         companion=CompanionInfo(
             address=self.address, udid=target.udid, is_local=self.is_local
         ),
     )
コード例 #3
0
ファイル: client.py プロジェクト: trantrungtin/idb
 async def describe(self,
                    fetch_diagnostics: bool = False) -> TargetDescription:
     response = await self.stub.describe(
         TargetDescriptionRequest(fetch_diagnostics=fetch_diagnostics))
     target = response.target_description
     return target_to_py(
         target=target,
         # Use the local understanding of the companion instead of the remote's.
         companion=CompanionInfo(address=self.address,
                                 udid=target.udid,
                                 is_local=self.is_local),
         # Extract the companion metadata from the response.
         metadata=response.companion.metadata,
     )
コード例 #4
0
ファイル: grpc.py プロジェクト: guhappranavk/idb
 async def _companion_to_target(
         self, companion: CompanionInfo) -> Optional[TargetDescription]:
     try:
         channel = Channel(host=companion.host,
                           port=companion.port,
                           loop=asyncio.get_event_loop())
         stub = CompanionServiceStub(channel=channel)
         response = await stub.describe(TargetDescriptionRequest())
         channel.close()
         return target_to_py(target=response.target_description,
                             companion_info=companion)
     except Exception:
         self.logger.warning(f"Failed to describe {companion}, removing it")
         await self.direct_companion_manager.remove_companion(
             Address(companion.host, companion.port))
         return None
コード例 #5
0
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     return target_to_py(target=response.target_description,
                         companion_info=None)