[appimage] improvement: faster reading of installed applications

This commit is contained in:
Vinicius Moreira
2021-11-29 11:36:42 -03:00
parent 8aa03d2a56
commit d9b6ee96ab
2 changed files with 6 additions and 3 deletions

View File

@@ -25,6 +25,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.22/missing_type_dep.png">
</p>
- AppImage
- faster reading of installed applications (subprocess call replaced by Python call)
- Web
- the Electron builds cache directory has been moved to the environment directory `~/.local/share/bauh/web/env/electron`

View File

@@ -254,11 +254,11 @@ class AppImageManager(SoftwareManager):
res = SearchResult(installed_apps, [], 0)
if os.path.exists(INSTALLATION_DIR):
installed = run_cmd(f'ls {INSTALLATION_DIR}/*/data.json', print_error=False)
installed = glob.glob(f'{INSTALLATION_DIR}/*/data.json')
if installed:
names = set()
for path in installed.split('\n'):
for path in installed:
if path:
with open(path) as f:
app = AppImage(installed=True, i18n=self.i18n, custom_actions=self.custom_app_actions, **json.loads(f.read()))