normalize Build TYPE_LIST data based on .txt

In the future, we should have better internal datatypes for this stuff,
i.e. instead of gradle: ['yes'] for True, actually use a boolean.  For now,
make the YAML and JSON metadata produce the same internal data as .txt.
This commit is contained in:
Hans-Christoph Steiner 2017-02-23 18:54:33 +01:00
parent f7ae398aae
commit c178cfb843
4 changed files with 175 additions and 177 deletions

View file

@ -818,6 +818,15 @@ def post_metadata_parse(app):
for build in app['builds']:
if not isinstance(build, Build):
build = Build(build)
for k, v in build.items():
if flagtype(k) == TYPE_LIST:
if isinstance(v, str):
build[k] = [v]
elif isinstance(v, bool):
if v:
build[k] = ['yes']
else:
build[k] = []
builds.append(build)
if not app.get('Description'):