Adjust formatting for live.yaml

This commit is contained in:
Edward Betts 2025-08-04 20:59:21 +01:00
parent ff0d81f32c
commit b856d90d14

View file

@ -302,6 +302,13 @@ def find_new_conference_web_sites(
return new
class NoAliasDumper(yaml.SafeDumper):
"""Dumper that disables YAML anchors and aliases."""
def ignore_aliases(self, data):
"""Skip alias generation."""
return True # disables anchors and aliases
def main(show_not_live: bool = False) -> None:
"""Check fow new conference web sites."""
live: list[LiveConference] = load_yaml("live")
@ -310,7 +317,14 @@ def main(show_not_live: bool = False) -> None:
live_filename = os.path.expanduser(config["data"]["live"])
with open(live_filename, "w") as out:
yaml.dump(live + new, stream=out, sort_keys=False)
yaml.dump(
live + new,
stream=out,
sort_keys=False,
Dumper=NoAliasDumper,
allow_unicode=True,
default_flow_style=False,
)
if __name__ == "__main__":