mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 15:30:28 +03:00
convert internal representation of AntiFeatures to list
The AntiFeatures metadata is a comma-separated list of tags, like Categories, so it should also be stored internally as a list. This makes parsing XML and JSON easier. The test cases' .pickle files look like they change a lot, but they really don't, its only the change of default AntiFeatures value from None to []
This commit is contained in:
parent
cc29d39f0a
commit
2831b3e93f
5 changed files with 2109 additions and 2134 deletions
|
|
@ -42,7 +42,7 @@ class MetaDataException(Exception):
|
|||
# In the order in which they are laid out on files
|
||||
app_defaults = OrderedDict([
|
||||
('Disabled', None),
|
||||
('AntiFeatures', None),
|
||||
('AntiFeatures', []),
|
||||
('Provides', None),
|
||||
('Categories', ['None']),
|
||||
('License', 'Unknown'),
|
||||
|
|
@ -516,7 +516,7 @@ def read_metadata(xref=True):
|
|||
def metafieldtype(name):
|
||||
if name in ['Description', 'Maintainer Notes']:
|
||||
return 'multiline'
|
||||
if name in ['Categories']:
|
||||
if name in ['Categories', 'AntiFeatures']:
|
||||
return 'list'
|
||||
if name == 'Build Version':
|
||||
return 'build'
|
||||
|
|
@ -929,7 +929,7 @@ def write_metadata(dest, app):
|
|||
|
||||
mf = open(dest, 'w')
|
||||
writefield_nonempty('Disabled')
|
||||
writefield_nonempty('AntiFeatures')
|
||||
writefield('AntiFeatures')
|
||||
writefield_nonempty('Provides')
|
||||
writefield('Categories')
|
||||
writefield('License')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue