Exemple #1
0
 def ensure_converted(self):
     if not self._converted:
         try:
             self._preset = Preset.from_json_dict(convert_to_current_version(copy.deepcopy(self.data)))
         except (ValueError, KeyError) as e:
             self.exception = InvalidPreset(e)
             raise self.exception from e
Exemple #2
0
 def from_json_dict(cls, param: dict) -> "Permalink":
     return Permalink(
         seed_number=param["seed"],
         spoiler=param["spoiler"],
         presets={
             index: Preset.from_json_dict(preset)
             for index, preset in enumerate(param["presets"])
         },
     )
Exemple #3
0
 def from_json_dict(cls, param: dict) -> "Permalink":
     return Permalink(
         seed_number=param["seed"],
         spoiler=param["spoiler"],
         preset=Preset.from_json_dict(param["preset"]),
     )