1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 11:00:10 +01:00

Properly convert boolean strings to bools as before

This commit is contained in:
Daniel Martí 2013-11-19 15:47:53 +01:00
parent fa3a591f15
commit 11f4165f37

View File

@ -107,15 +107,19 @@ valuetypes = {
def check_metadata(info): def check_metadata(info):
for k, t in valuetypes.iteritems(): for k, t in valuetypes.iteritems():
for field in [f for f in t.fields if f in info]: for field in t.fields:
t.check(info[field], info['id']) if field in info:
if k == 'Bool': t.check(info[field], info['id'])
info[field] = info[field] == "Yes" if k == 'Bool':
info[field] = info[field] == "Yes"
for build in info['builds']: for build in info['builds']:
for attr in [a for a in t.attrs if a in build]: for attr in t.attrs:
t.check(build[attr], info['id']) if attr in build:
if k == 'bool': t.check(build[attr], info['id'])
info[field] = info[field] == "yes" if k == 'bool':
build[attr] = build[attr] == "yes"
elif k == 'bool':
build[attr] = False
# Formatter for descriptions. Create an instance, and call parseline() with # Formatter for descriptions. Create an instance, and call parseline() with
# each line of the description source from the metadata. At the end, call # each line of the description source from the metadata. At the end, call