Represents metadata of the project https://en.scratch-wiki.info/wiki/Scratch_File_Format#Metadata
(self, semver: str = "3.0.0", vm: str = DEFAULT_VM, agent: str = DEFAULT_AGENT,
platform: Optional[PlatformMeta] = None)
| 51 | |
| 52 | class Meta(base.JSONSerializable): |
| 53 | def __init__(self, semver: str = "3.0.0", vm: str = DEFAULT_VM, agent: str = DEFAULT_AGENT, |
| 54 | platform: Optional[PlatformMeta] = None): |
| 55 | """ |
| 56 | Represents metadata of the project |
| 57 | https://en.scratch-wiki.info/wiki/Scratch_File_Format#Metadata |
| 58 | """ |
| 59 | if platform is None and META_SET_PLATFORM: |
| 60 | platform = DEFAULT_PLATFORM.dcopy() |
| 61 | |
| 62 | self.semver = semver |
| 63 | self.vm = vm |
| 64 | self.agent = agent |
| 65 | self.platform = platform |
| 66 | |
| 67 | if not self.vm_is_valid: |
| 68 | raise ValueError( |
| 69 | f"{vm!r} does not match pattern '^([0-9]+\\.[0-9]+\\.[0-9]+)($|-)' - maybe try '0.0.0'?") |
| 70 | |
| 71 | def __repr__(self): |
| 72 | data = f"{self.semver} : {self.vm} : {self.agent}" |