def treat_page(self) -> None:
"""Load the given page, do some changes, and save it."""
- content_json = json.loads(self.current_page.text)
+ sledrun_json_page = Page(self.site, self.current_page.title() + '/Rodelbahn.json')
+ if not sledrun_json_page.exists():
+ return
+ content_json = json.loads(sledrun_json_page.text)
try:
validate(instance=content_json, schema=self.sledrun_schema)
text = str(e)
summary = 'JSON Daten aktualisiert.'
- self.put_current(text, summary=summary)
+ self.userPut(sledrun_json_page, sledrun_json_page.text, text, summary=summary, contentmodel='json')
def main(*args: str) -> None: