mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 18:50:11 +02:00
set appid in get_default_app_info_list()
This commit is contained in:
parent
0425788b7d
commit
0b62e7f22a
@ -572,9 +572,11 @@ def split_list_values(s):
|
|||||||
return [v for v in l if v]
|
return [v for v in l if v]
|
||||||
|
|
||||||
|
|
||||||
def get_default_app_info_list():
|
def get_default_app_info_list(appid=None):
|
||||||
thisinfo = {}
|
thisinfo = {}
|
||||||
thisinfo.update(app_defaults)
|
thisinfo.update(app_defaults)
|
||||||
|
if appid is not None:
|
||||||
|
thisinfo['id'] = appid
|
||||||
|
|
||||||
# General defaults...
|
# General defaults...
|
||||||
thisinfo['builds'] = []
|
thisinfo['builds'] = []
|
||||||
@ -706,8 +708,7 @@ def _decode_dict(data):
|
|||||||
def parse_json_metadata(metafile):
|
def parse_json_metadata(metafile):
|
||||||
|
|
||||||
appid = os.path.basename(metafile)[0:-5] # strip path and .json
|
appid = os.path.basename(metafile)[0:-5] # strip path and .json
|
||||||
thisinfo = get_default_app_info_list()
|
thisinfo = get_default_app_info_list(appid)
|
||||||
thisinfo['id'] = appid
|
|
||||||
|
|
||||||
# fdroid metadata is only strings and booleans, no floats or ints. And
|
# fdroid metadata is only strings and booleans, no floats or ints. And
|
||||||
# json returns unicode, and fdroidserver still uses plain python strings
|
# json returns unicode, and fdroidserver still uses plain python strings
|
||||||
@ -725,8 +726,7 @@ def parse_json_metadata(metafile):
|
|||||||
def parse_xml_metadata(metafile):
|
def parse_xml_metadata(metafile):
|
||||||
|
|
||||||
appid = os.path.basename(metafile)[0:-4] # strip path and .xml
|
appid = os.path.basename(metafile)[0:-4] # strip path and .xml
|
||||||
thisinfo = get_default_app_info_list()
|
thisinfo = get_default_app_info_list(appid)
|
||||||
thisinfo['id'] = appid
|
|
||||||
|
|
||||||
tree = ElementTree.ElementTree(file=metafile)
|
tree = ElementTree.ElementTree(file=metafile)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
Loading…
Reference in New Issue
Block a user