def __enter__(self): if not self._recursive: return self converted = [] for platform, child in self._image: if isinstance(child, docker_image_list.DockerImageList): with ListFromIndex(child) as image_list: converted.append((platform, image_list)) else: assert isinstance(child, docker_image.DockerImage) with V22FromOCI(child) as v22: converted.append((platform, v22)) with docker_image_list.FromList(converted) as image_list: self._image = image_list return self
def __enter__(self): if not self._recursive: return self converted = [] for platform, child in self._image: if isinstance(child, docker_image_list.DockerImageList): with IndexFromList(child) as index: converted.append((platform, index)) else: assert isinstance(child, docker_image.DockerImage) with OCIFromV22(child) as oci: converted.append((platform, oci)) with docker_image_list.FromList(converted) as index: self._image = index return self