From d9b6ee96abc73904db63cb91cc573c57b96eb044 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 29 Nov 2021 11:36:42 -0300 Subject: [PATCH] [appimage] improvement: faster reading of installed applications --- CHANGELOG.md | 5 ++++- bauh/gems/appimage/controller.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ed76e2..85b60777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- + +- 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` diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 844f4356..36440d98 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -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()))