Exemple #1
0
    def Get(self):
        """Fetch file's data and return proper File object."""

        args = vfs_pb2.ApiGetFileDetailsArgs(client_id=self.client_id,
                                             file_path=self.path)
        data = self._context.SendRequest("GetFileDetails", args).file
        return File(client_id=self.client_id, data=data, context=self._context)
Exemple #2
0
  def Get(self) -> "File":
    """Fetch file's data and return proper File object."""

    args = vfs_pb2.ApiGetFileDetailsArgs(
        client_id=self.client_id, file_path=self.path)

    data = self._context.SendRequest("GetFileDetails", args)
    if not isinstance(data, vfs_pb2.ApiGetFileDetailsResult):
      raise TypeError(f"Unexpected result type: {type(data)}")

    return File(client_id=self.client_id, data=data.file, context=self._context)