Beispiel #1
0
    def delete_manifest(self, app_name):
        if not self.manifests:
            self.read_manifests()
        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'))
Beispiel #2
0
    def get_manifest(self, app_name) -> EGLManifest:
        if not self.manifests:
            self.read_manifests()

        if app_name in self.manifests:
            return EGLManifest.from_json(self.manifests[app_name])
        else:
            raise ValueError('Cannot find manifest')
Beispiel #3
0
    def set_manifest(self, manifest: EGLManifest):
        if not self.programdata_path:
            raise ValueError('EGS ProgramData path is not set')

        manifest_data = manifest.to_json()
        self.manifests[manifest.app_name] = manifest_data
        _path = os.path.join(self.programdata_path, f'{manifest.installation_guid}.item')
        with open(_path, 'w', encoding='utf-8') as f:
            json.dump(manifest_data, f, indent=4, sort_keys=True)
Beispiel #4
0
    def get_manifests(self) -> List[EGLManifest]:
        if not self.manifests:
            self.read_manifests()

        return [EGLManifest.from_json(m) for m in self.manifests.values()]