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

Class Extension

scratchattach/editor/extension.py:15–35  ·  view source on GitHub ↗

Represents an extension in the Scratch block pallete - e.g. video sensing

Source from the content-addressed store, hash-verified

13
14@dataclass
15class Extension(base.JSONSerializable):
16 """
17 Represents an extension in the Scratch block pallete - e.g. video sensing
18 """
19 code: str
20 name: str = None
21
22 def __eq__(self, other):
23 return self.code == other.code
24
25 @staticmethod
26 def from_json(data: str):
27 assert isinstance(data, str)
28 _extension = Extensions.find(data, "code")
29 if _extension is None:
30 _extension = Extension(data)
31
32 return _extension
33
34 def to_json(self) -> str:
35 return self.code
36
37
38class Extensions(enums._EnumWrapper):

Callers 2

from_jsonMethod · 0.85
ExtensionsClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected