MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / PlatformMeta

Class PlatformMeta

scratchattach/editor/meta.py:11–31  ·  view source on GitHub ↗

Represents a TurboWarp platform meta object

Source from the content-addressed store, hash-verified

9
10@dataclass
11class PlatformMeta(base.JSONSerializable):
12 """
13 Represents a TurboWarp platform meta object
14 """
15 name: str = None
16 url: str = field(repr=True, default=None)
17
18 def __bool__(self):
19 return self.name is not None or self.url is not None
20
21 def to_json(self):
22 _json = {"name": self.name, "url": self.url}
23 commons.remove_nones(_json)
24 return _json
25
26 @staticmethod
27 def from_json(data: dict | None):
28 if data is None:
29 return PlatformMeta()
30 else:
31 return PlatformMeta(data.get("name"), data.get("url"))
32
33
34DEFAULT_VM = "0.1.0"

Callers 2

from_jsonMethod · 0.85
meta.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected