rewritemeta: rewrite AntiFeature str entries like Categories

This commit is contained in:
Hans-Christoph Steiner 2018-10-09 23:49:27 +02:00
parent 6e6afeec65
commit 58b14279af

View file

@ -901,10 +901,14 @@ def post_metadata_parse(app):
if 'flavours' in app and app['flavours'] == [True]: if 'flavours' in app and app['flavours'] == [True]:
app['flavours'] = 'yes' app['flavours'] = 'yes'
if isinstance(app.Categories, str): for field, fieldtype in fieldtypes.items():
app.Categories = [app.Categories] if fieldtype != TYPE_LIST:
else: continue
app.Categories = [str(i) for i in app.Categories] value = app.get(field)
if isinstance(value, str):
app[field] = [value, ]
elif value is not None:
app[field] = [str(i) for i in value]
def _yaml_bool_unmapable(v): def _yaml_bool_unmapable(v):
return v in (True, False, [True], [False]) return v in (True, False, [True], [False])