def update_remote_machine_avatar(self): iterator = self.stub.GetRemoteMachineAvatar(void) loader = None try: for info in iterator: if loader == None: loader = util.CairoSurfaceLoader() loader.add_bytes(info.avatar_chunk) except grpc.RpcError as e: print( "Could not fetch remote avatar, using a generic one. (%s, %s)" % (e.code(), e.details())) self.get_avatar_surface(loader)
def update_remote_machine_avatar(self): logging.debug("Remote RPC: calling GetRemoteMachineAvatar on '%s'" % self.display_hostname) iterator = self.stub.GetRemoteMachineAvatar( warp_pb2.LookupName(id=self.local_ident, readable_name=util.get_hostname())) loader = None try: for info in iterator: if loader == None: loader = util.CairoSurfaceLoader() loader.add_bytes(info.avatar_chunk) except grpc.RpcError as e: logging.debug( "Remote RPC: could not fetch remote avatar, using a generic one. (%s, %s)" % (e.code(), e.details())) self.get_avatar_surface(loader)