eliminate Boolean metadata type, only 'bool' is needed

No need for a specific metadata type for 'Requires Root'.  Just use 'bool',
then convert on output.  This keeps the internal representation consistent
since all boolean-ish values will be Python bools.  This in turn makes
parsing metadata in various formats easier.  This also makes setting
booleans more tolerant since all these values are valid:

 Yes yes No no True true False false
This commit is contained in:
Hans-Christoph Steiner 2015-07-23 16:33:08 -07:00
parent ab145de6bc
commit 014df8426f
2 changed files with 15 additions and 25 deletions

View file

@ -95,6 +95,10 @@ def update_wiki(apps, sortedids, apks):
if 'AntiFeatures' in app:
for af in app['AntiFeatures']:
wikidata += '{{AntiFeature|' + af + '}}\n'
if app['Requires Root']:
requiresroot = 'Yes'
else:
requiresroot = 'No'
wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|dogecoin=%s|license=%s|root=%s}}\n' % (
appid,
app['Name'],
@ -110,7 +114,7 @@ def update_wiki(apps, sortedids, apks):
app['Litecoin'],
app['Dogecoin'],
app['License'],
app.get('Requires Root', 'No'))
requiresroot)
if app['Provides']:
wikidata += "This app provides: %s" % ', '.join(app['Summary'].split(','))