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

Method from_dict

ci/util/pio_package_messages.py:301–326  ·  view source on GitHub ↗

Create BuildRequest from dictionary. Args: data: Dictionary with request fields Returns: BuildRequest 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

299
300 @classmethod
301 def from_dict(cls, data: dict[str, Any]) -> "BuildRequest":
302 """Create BuildRequest from dictionary.
303
304 Args:
305 data: Dictionary with request fields
306
307 Returns:
308 BuildRequest instance
309
310 Raises:
311 TypeError: If required fields are missing or have wrong types
312 """
313 command = BuildCommand.from_string(data["command"])
314
315 return cls(
316 project_dir=data["project_dir"],
317 environment=data["environment"],
318 command=command,
319 example=data["example"],
320 caller_pid=data["caller_pid"],
321 caller_cwd=data["caller_cwd"],
322 timestamp=data.get("timestamp", time.time()),
323 request_id=data.get("request_id", f"build_{int(time.time() * 1000)}"),
324 upload_port=data.get("upload_port"),
325 additional_args=data.get("additional_args", []),
326 )
327
328
329@typechecked

Callers

nothing calls this directly

Calls 3

timeMethod · 0.80
from_stringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected