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

Method from_dict

ci/util/pio_package_messages.py:372–397  ·  view source on GitHub ↗

Create BuildStatus from dictionary. Args: data: Dictionary with status fields Returns: BuildStatus instance Raises: TypeError: If required fields are missing or have wrong types

(cls, data: dict[str, Any])

Source from the content-addressed store, hash-verified

370
371 @classmethod
372 def from_dict(cls, data: dict[str, Any]) -> "BuildStatus":
373 """Create BuildStatus from dictionary.
374
375 Args:
376 data: Dictionary with status fields
377
378 Returns:
379 BuildStatus instance
380
381 Raises:
382 TypeError: If required fields are missing or have wrong types
383 """
384 state = BuildState.from_string(data["state"])
385
386 return cls(
387 request_id=data["request_id"],
388 state=state,
389 message=data.get("message", ""),
390 updated_at=data.get("updated_at", time.time()),
391 output_lines=data.get("output_lines", []),
392 exit_code=data.get("exit_code"),
393 root_pid=data.get("root_pid"),
394 child_pids=data.get("child_pids", []),
395 started_at=data.get("started_at"),
396 completed_at=data.get("completed_at"),
397 )
398
399 def get_age_seconds(self) -> float:
400 """Get age of this status update in seconds.

Callers 7

read_status_fileFunction · 0.45
read_status_file_safeFunction · 0.45
read_request_fileFunction · 0.45
test_from_dictMethod · 0.45
test_roundtripMethod · 0.45
test_from_dictMethod · 0.45
test_roundtripMethod · 0.45

Calls 3

timeMethod · 0.80
from_stringMethod · 0.45
getMethod · 0.45

Tested by 4

test_from_dictMethod · 0.36
test_roundtripMethod · 0.36
test_from_dictMethod · 0.36
test_roundtripMethod · 0.36