コード例 #1
0
ファイル: machines.py プロジェクト: sahwar/warp
    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)
コード例 #2
0
ファイル: remote.py プロジェクト: mtwebster/warp
    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)