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

Function read_breadcrumb

ci/util/download_breadcrumb.py:39–57  ·  view source on GitHub ↗

Read breadcrumb data from a JSON file. Args: breadcrumb_path: Path to the breadcrumb file Returns: Dictionary with breadcrumb data, or None if file doesn't exist or is invalid

(breadcrumb_path: Path)

Source from the content-addressed store, hash-verified

37
38
39def read_breadcrumb(breadcrumb_path: Path) -> Optional[dict[str, Any]]:
40 """
41 Read breadcrumb data from a JSON file.
42
43 Args:
44 breadcrumb_path: Path to the breadcrumb file
45
46 Returns:
47 Dictionary with breadcrumb data, or None if file doesn't exist or is invalid
48 """
49 if not breadcrumb_path.exists():
50 return None
51
52 try:
53 with open(breadcrumb_path, "r") as f:
54 return json.load(f)
55 except (json.JSONDecodeError, OSError) as e:
56 logger.warning(f"Failed to read breadcrumb {breadcrumb_path}: {e}")
57 return None
58
59
60def write_breadcrumb(breadcrumb_path: Path, data: dict[str, Any]) -> bool:

Callers 2

is_download_completeFunction · 0.85
update_breadcrumb_statusFunction · 0.85

Calls 2

warningMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected