Backups: Make Manifest a dict instead of a list

So it's possible to add more information like metadata etc.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Michael Pimmer authored and James Valleroy committed 2018-11-18 13:58:41 -05:00
1 parent 7aed74a9bd
commit e2584be45d
2 files changed
+24 -7

No files matched your search

+7 -5
View File
@@ -84,11 +84,13 @@ def _backup_handler(packet):
manifest_path = os.path.join(MANIFESTS_FOLDER,
get_valid_filename(packet.label) + '.json')
manifests = [{
'name': app.name,
'version': app.app.version,
'backup': app.manifest
} for app in packet.apps]
manifests = {
'apps': [{
'name': app.name,
'version': app.app.version,
'backup': app.manifest
} for app in packet.apps]
}
with open(manifest_path, 'w') as manifest_file:
json.dump(manifests, manifest_file)