From: Daniel Martí Date: Mon, 17 Jun 2013 16:15:11 +0000 (+0200) Subject: Create comma-separated lists in the Python way X-Git-Tag: 0.1~531^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a3e082ab7fa36a08a6caf4ce16fc6d81b18a4e36;p=fdroidserver.git Create comma-separated lists in the Python way --- diff --git a/fdroidserver/update.py b/fdroidserver/update.py index ee25daf6..ce1934fe 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -528,19 +528,10 @@ def make_index(apps, apks, repodir, archive, categories): if 'added' in apk: addElement('added', time.strftime('%Y-%m-%d', apk['added']), doc, apkel) perms = "" - for p in apk['permissions']: - if len(perms) > 0: - perms += "," - perms += p - 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) + if len(apk['permissions']) > 0: + addElement('permissions', ','.join(apk['permissions']), doc, apkel) + if len(apk['features') > 0: + addElement('features', ','.join(apk['features']), doc, apkel) of = open(os.path.join(repodir, 'index.xml'), 'wb') if options.pretty: