MCPcopy Create free account
hub / github.com/FastLED/FastLED / check_image_exists

Method check_image_exists

ci/docker_utils/qemu_esp32_docker.py:191–216  ·  view source on GitHub ↗

Check if Docker image exists locally. Args: image_name: Name of the Docker image to check Returns: True if image exists, False otherwise

(self, image_name: str)

Source from the content-addressed store, hash-verified

189 return False
190
191 def check_image_exists(self, image_name: str) -> bool:
192 """Check if Docker image exists locally.
193
194 Args:
195 image_name: Name of the Docker image to check
196
197 Returns:
198 True if image exists, False otherwise
199 """
200 try:
201 proc = RunningProcess(
202 ["docker", "images", "-q", image_name],
203 env=get_docker_env(),
204 auto_run=True,
205 )
206 stdout_lines: list[str] = []
207 with proc.line_iter(timeout=None) as it:
208 for line in it:
209 stdout_lines.append(line)
210 result_stdout = "\n".join(stdout_lines)
211 return bool(result_stdout.strip())
212 except KeyboardInterrupt as ki:
213 handle_keyboard_interrupt(ki)
214 raise
215 except Exception:
216 return False
217
218 def get_board_image_name(self, platform: str) -> str:
219 """Get Docker image name for board platform.

Callers 1

run_qemu_testsFunction · 0.95

Calls 3

get_docker_envFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected