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

Create comma-separated lists in the Python way

This commit is contained in:
Daniel Martí 2013-06-17 18:15:11 +02:00
parent 6be27ed572
commit a3e082ab7f

View File

@ -528,19 +528,10 @@ def make_index(apps, apks, repodir, archive, categories):
if 'added' in apk: if 'added' in apk:
addElement('added', time.strftime('%Y-%m-%d', apk['added']), doc, apkel) addElement('added', time.strftime('%Y-%m-%d', apk['added']), doc, apkel)
perms = "" perms = ""
for p in apk['permissions']: if len(apk['permissions']) > 0:
if len(perms) > 0: addElement('permissions', ','.join(apk['permissions']), doc, apkel)
perms += "," if len(apk['features') > 0:
perms += p addElement('features', ','.join(apk['features']), doc, apkel)
if len(perms) > 0:
addElement('permissions', perms, doc, apkel)
features = ""
for f in apk['features']:
if len(features) > 0:
features += ","
features += f
if len(features) > 0:
addElement('features', features, doc, apkel)
of = open(os.path.join(repodir, 'index.xml'), 'wb') of = open(os.path.join(repodir, 'index.xml'), 'wb')
if options.pretty: if options.pretty: