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

Method from_json

scratchattach/editor/meta.py:98–117  ·  view source on GitHub ↗
(data: dict[str, str | dict[str, str]] | None)

Source from the content-addressed store, hash-verified

96
97 @staticmethod
98 def from_json(data: dict[str, str | dict[str, str]] | None):
99 if data is None:
100 data = {"semver": "3.0.0"}
101
102 semver = data["semver"]
103 vm = data.get("vm")
104 agent = data.get("agent")
105 platform = PlatformMeta.from_json(data.get("platform"))
106
107 if EDIT_META or vm is None:
108 vm = DEFAULT_VM
109
110 if EDIT_META or agent is None:
111 agent = DEFAULT_AGENT
112
113 if EDIT_META:
114 if META_SET_PLATFORM and not platform:
115 platform = DEFAULT_PLATFORM.dcopy()
116
117 return Meta(semver, vm, agent, platform)

Callers

nothing calls this directly

Calls 3

MetaClass · 0.85
dcopyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected