(cls, data: dict[str, Any])
| 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 | |
| 55 | def get_status_dir() -> Path: |
no test coverage detected