MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / from_dict

Method from_dict

relay/status_file.py:36–52  ·  view source on GitHub ↗
(cls, data: dict[str, Any])

Source from the content-addressed store, hash-verified

34
35 @classmethod
36 def from_dict(cls, data: dict[str, Any]) -> StatusFileContent:
37 timestamp_str = data.get("timestamp", "")
38 try:
39 timestamp = datetime.fromisoformat(timestamp_str.replace("Z", "+00:00"))
40 except (ValueError, TypeError):
41 timestamp = datetime.now(UTC)
42
43 return cls(
44 instance_id=data.get("instance_id", ""),
45 project_name=data.get("project_name", ""),
46 unity_version=data.get("unity_version", ""),
47 status=data.get("status", "ready"),
48 relay_host=data.get("relay_host", "127.0.0.1"),
49 relay_port=data.get("relay_port", 6500),
50 timestamp=timestamp,
51 seq=data.get("seq", 0),
52 )
53
54
55def get_status_dir() -> Path:

Callers 2

read_status_fileFunction · 0.80
read_all_status_filesFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected