mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[lfs] Fix JSON writing and add delete_manifest method
This commit is contained in:
parent
09c8d1f80d
commit
4ace27bbcc
|
@ -67,5 +67,12 @@ class EPCLFS:
|
||||||
|
|
||||||
manifest_data = manifest.to_json()
|
manifest_data = manifest.to_json()
|
||||||
self.manifests[manifest.app_name] = manifest_data
|
self.manifests[manifest.app_name] = manifest_data
|
||||||
with open(os.path.join(self.programdata_path, f'{manifest.installation_guid}.item', 'wb')) as f:
|
with open(os.path.join(self.programdata_path, f'{manifest.installation_guid}.item'), 'w') as f:
|
||||||
json.dump(manifest_data, f, indent=4, sort_keys=True)
|
json.dump(manifest_data, f, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
def delete_manifest(self, app_name):
|
||||||
|
if app_name not in self.manifests:
|
||||||
|
raise ValueError('AppName is not in manifests!')
|
||||||
|
|
||||||
|
manifest = EGLManifest.from_json(self.manifests.pop(app_name))
|
||||||
|
os.remove(os.path.join(self.programdata_path, f'{manifest.installation_guid}.item'))
|
||||||
|
|
Loading…
Reference in a new issue