Re-order app_defaults to match the writing order

Also fix a couple of issues:

* Update Check Name was never written to disk
* Maintainer Notes had no default and was used differently
This commit is contained in:
Daniel Martí 2014-05-30 19:49:38 +02:00
parent e93017569f
commit b594558811

View file

@ -34,12 +34,10 @@ class MetaDataException(Exception):
return self.value return self.value
app_defaults = { app_defaults = {
'Name': None, 'Disabled': None,
'AntiFeatures': None,
'Provides': None, 'Provides': None,
'Auto Name': '',
'Categories': ['None'], 'Categories': ['None'],
'Description': [],
'Summary': '',
'License': 'Unknown', 'License': 'Unknown',
'Web Site': '', 'Web Site': '',
'Source Code': '', 'Source Code': '',
@ -49,20 +47,23 @@ app_defaults = {
'Bitcoin': None, 'Bitcoin': None,
'Litecoin': None, 'Litecoin': None,
'Dogecoin': None, 'Dogecoin': None,
'Disabled': None, 'Name': None,
'AntiFeatures': None, 'Auto Name': '',
'Archive Policy': None, 'Summary': '',
'Update Check Mode': 'None', 'Description': [],
'Update Check Ignore': None, 'Requires Root': False,
'Update Check Name': None,
'Update Check Data': None,
'Vercode Operation': None,
'Auto Update Mode': 'None',
'Current Version': '',
'Current Version Code': '0',
'Repo Type': '', 'Repo Type': '',
'Repo': '', 'Repo': '',
'Requires Root': False, 'Maintainer Notes': [],
'Archive Policy': None,
'Auto Update Mode': 'None',
'Update Check Mode': 'None',
'Update Check Ignore': None,
'Vercode Operation': None,
'Update Check Name': None,
'Update Check Data': None,
'Current Version': '',
'Current Version Code': '0',
'No Source Since': '' 'No Source Since': ''
} }
@ -842,7 +843,7 @@ def write_metadata(dest, app):
write_builditem(key, build[key]) write_builditem(key, build[key])
mf.write('\n') mf.write('\n')
if 'Maintainer Notes' in app: if app['Maintainer Notes']:
writefield('Maintainer Notes', '') writefield('Maintainer Notes', '')
for line in app['Maintainer Notes']: for line in app['Maintainer Notes']:
mf.write("%s\n" % line) mf.write("%s\n" % line)
@ -857,6 +858,8 @@ def write_metadata(dest, app):
writefield('Update Check Ignore') writefield('Update Check Ignore')
if app['Vercode Operation']: if app['Vercode Operation']:
writefield('Vercode Operation') writefield('Vercode Operation')
if app['Update Check Name']:
writefield('Update Check Name')
if app['Update Check Data']: if app['Update Check Data']:
writefield('Update Check Data') writefield('Update Check Data')
if app['Current Version']: if app['Current Version']: