コード例 #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 _companion_to_target(
         self, companion: CompanionInfo) -> TargetDescription:
     channel = Channel(companion.host,
                       companion.port,
                       loop=asyncio.get_event_loop())
     stub = CompanionServiceStub(channel=channel)
     response = await stub.describe(TargetDescriptionRequest())
     channel.close()
     return target_to_py(response.target_description)
コード例 #3
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
         ),
     )
コード例 #4
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,
     )
コード例 #5
0
 async def _companion_to_target(
         self, companion: CompanionInfo) -> Optional[TargetDescription]:
     try:
         channel = Channel(companion.host,
                           companion.port,
                           loop=asyncio.get_event_loop())
         stub = CompanionServiceStub(channel=channel)
         response = await stub.describe(TargetDescriptionRequest())
         channel.close()
         return target_to_py(response.target_description)
     except Exception:
         self.logger.warning(f"Failed to describe {companion}, removing it")
         self.direct_companion_manager.remove_companion(
             Address(companion.host, companion.port))
         return None
コード例 #6
0
ファイル: grpc.py プロジェクト: zeng4250538/idb
 async def describe(self) -> TargetDescription:
     async with self.get_stub() as stub:
         response = await stub.describe(TargetDescriptionRequest())
         return target_to_py(response.target_description)
コード例 #7
0
async def client(client: CompanionClient) -> TargetDescriptionResponse:
    return await client.stub.describe(TargetDescriptionRequest())
コード例 #8
0
ファイル: grpc.py プロジェクト: page66688/idb
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     return target_to_py(response.target_description)
コード例 #9
0
async def client(client: CompanionClient) -> TargetDescription:
    response = await client.stub.describe(TargetDescriptionRequest())
    return target_to_py(response.target_description)
コード例 #10
0
ファイル: grpc.py プロジェクト: Vishalan/idb
 async def describe(self) -> TargetDescription:
     response = await self.stub.describe(TargetDescriptionRequest())
     return target_to_py(target=response.target_description,
                         companion_info=None)