From: Hans-Christoph Steiner Date: Wed, 22 Jul 2015 18:10:52 +0000 (-0700) Subject: metadata: store comments in lists since lists are used everywhere else X-Git-Tag: 0.5.0~140^2~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cc29d39f0a2f3d4745c5ff0c4d3cbc902c6aba75;p=fdroidserver.git metadata: store comments in lists since lists are used everywhere else The only data produced by parsing metadata that was stored as a tuple was the comments' key/values. Everywhere else, lists are used. This changes the comments to also only use lists to keep the data consistent internally. That makes it vastly easier to produce the exact same metadata dict when parsing .txt, JSON, XML, etc. --- diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 58b774a3..3684b917 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -604,7 +604,7 @@ def post_metadata_parse(thisinfo): # 'builds' - a list of dictionaries containing build information # for each defined build # 'comments' - a list of comments from the metadata file. Each is -# a tuple of the form (field, comment) where field is +# a list of the form [field, comment] where field is # the name of the field it preceded in the metadata # file. Where field is None, the comment goes at the # end of the file. Alternatively, 'build:version' is @@ -769,7 +769,7 @@ def parse_txt_metadata(metafile): if not curcomments: return for comment in curcomments: - thisinfo['comments'].append((key, comment)) + thisinfo['comments'].append([key, comment]) del curcomments[:] thisinfo = get_default_app_info_list()