["Dogecoin"],
[]),
- FieldValidator("Boolean",
- ['Yes', 'No'], None,
- ["Requires Root"],
- []),
-
FieldValidator("bool",
- ['yes', 'no'], None,
- [],
+ r'([Yy]es|[Nn]o|[Tt]rue|[Ff]alse)', None,
+ ["Requires Root"],
['submodules', 'oldsdkloc', 'forceversion', 'forcevercode',
'novcheck']),
elif k == 'versionName':
build['version'] = str(v)
del build['versionName']
- elif flagtype(k) == 'bool':
- if v == 'no':
- build[k] = False
- else:
- build[k] = True
if not thisinfo['Description']:
thisinfo['Description'].append('No description available')
parse_float=lambda s: s)
supported_metadata = app_defaults.keys() + ['builds', 'comments']
for k, v in jsoninfo.iteritems():
- if k == 'Requires Root':
- if isinstance(v, basestring):
- if re.match('^\s*(yes|true).*', v, flags=re.IGNORECASE):
- jsoninfo[k] = 'Yes'
- elif re.match('^\s*(no|false).*', v, flags=re.IGNORECASE):
- jsoninfo[k] = 'No'
- if isinstance(v, bool):
- if v:
- jsoninfo[k] = 'Yes'
- else:
- jsoninfo[k] = 'No'
if k not in supported_metadata:
logging.warn(metafile + ' contains unknown metadata key, ignoring: ' + k)
thisinfo.update(jsoninfo)
builds.append(builddict)
thisinfo['builds'] = builds
+ # TODO handle this using <xsd:element type="xsd:boolean> in a schema
+ if not isinstance(thisinfo['Requires Root'], bool):
+ if thisinfo['Requires Root'] == 'true':
+ thisinfo['Requires Root'] = True
+ else:
+ thisinfo['Requires Root'] = False
+
# convert to the odd internal format
for k in ('Description', 'Maintainer Notes'):
if isinstance(thisinfo[k], basestring):
mf.write('.\n')
mf.write('\n')
if app['Requires Root']:
- writefield('Requires Root', 'Yes')
+ writefield('Requires Root', 'yes')
mf.write('\n')
if app['Repo Type']:
writefield('Repo Type')
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'],
app['Litecoin'],
app['Dogecoin'],
app['License'],
- app.get('Requires Root', 'No'))
+ requiresroot)
if app['Provides']:
wikidata += "This app provides: %s" % ', '.join(app['Summary'].split(','))