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

Fixes to categories in update.py

This commit is contained in:
Daniel Martí 2013-11-02 16:04:50 +01:00
parent f1526faa47
commit 79a24e3e11

View File

@ -528,12 +528,12 @@ def make_index(apps, apks, repodir, archive, categories):
common.description_html(app['Description'], linkres), doc, apel) common.description_html(app['Description'], linkres), doc, apel)
addElement('license', app['License'], doc, apel) addElement('license', app['License'], doc, apel)
if 'Categories' in app: if 'Categories' in app:
categories = [c.strip() for c in app['Categories'].split(',')] appcategories = [c.strip() for c in app['Categories'].split(',')]
addElement('categories', ','.join(categories), doc, apel) addElement('categories', ','.join(appcategories), doc, apel)
# We put the first (primary) category in LAST, which will have # We put the first (primary) category in LAST, which will have
# the desired effect of making clients that only understand one # the desired effect of making clients that only understand one
# category see that one. # category see that one.
addElement('category', categories[0], doc, apel) addElement('category', appcategories[0], doc, apel)
addElement('web', app['Web Site'], doc, apel) addElement('web', app['Web Site'], doc, apel)
addElement('source', app['Source Code'], doc, apel) addElement('source', app['Source Code'], doc, apel)
addElement('tracker', app['Issue Tracker'], doc, apel) addElement('tracker', app['Issue Tracker'], doc, apel)
@ -731,7 +731,7 @@ def main():
# Generate a list of categories... # Generate a list of categories...
categories = [] categories = []
for app in apps: for app in apps:
cats = app['Category'].split(';') cats = app['Categories'].split(',')
for cat in cats: for cat in cats:
if cat not in categories: if cat not in categories:
categories.append(cat) categories.append(cat)