From e93acf79642d1bdaeaa35976d270e21c54a4c872 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 9 Dec 2020 19:27:37 +0100 Subject: [PATCH] metadata: work with dicts generated by standard YAML parsers Now that the mismatch between 'builds' and 'Builds' has been fixed, it is now possible to read metadata/*.yml files with a standard YAML parser like PyYAML, then output them using `metadata.write_metadata()`. Other API functions in fdroidserver should also work in this case. I did this as I was working on fdroiddata!7860 --- fdroidserver/metadata.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 6af19c1f..ff75aa8a 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -940,6 +940,8 @@ def write_yaml(mf, app): def _builds_to_yaml(app): builds = ruamel.yaml.comments.CommentedSeq() for build in app.get('Builds', []): + if not isinstance(build, Build): + build = Build(build) b = ruamel.yaml.comments.CommentedMap() for field in build_flags: value = getattr(build, field)