From a3c35ff08a4cd22bbd5c99e824caa1bc556d1d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Moreira?= Date: Fri, 13 Dec 2019 19:06:38 -0300 Subject: [PATCH] [wgem] fix when ~/.local/share/applications does not exist --- bauh/gems/web/controller.py | 4 +++- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index 1306f462..9ed15dae 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -19,7 +19,7 @@ from bauh.api.abstract.handler import ProcessWatcher from bauh.api.abstract.model import SoftwarePackage, PackageAction, PackageSuggestion, PackageUpdate, PackageHistory from bauh.api.abstract.view import MessageType, MultipleSelectComponent, InputOption, SingleSelectComponent, \ SelectViewType, TextInputComponent, FormComponent -from bauh.api.constants import HOME_PATH +from bauh.api.constants import HOME_PATH, DESKTOP_ENTRIES_DIR from bauh.commons.html import bold from bauh.commons.system import ProcessHandler, get_dir_size, get_human_size_str from bauh.gems.web import INSTALLED_PATH, nativefier, DESKTOP_ENTRY_PATH_PATTERN, URL_FIX_PATTERN @@ -396,6 +396,8 @@ class WebApplicationManager(SoftwareManager): entry_content = self._gen_desktop_entry_content(pkg) + Path(DESKTOP_ENTRIES_DIR).mkdir(parents=True, exist_ok=True) + with open(desktop_entry_path, 'w+') as f: f.write(entry_content) diff --git a/requirements.txt b/requirements.txt index 9e4762fe..c1515abb 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ pyqt5>=5.12 requests>=2.22 colorama>=0.4.1 -pyyaml>=5.2 +pyyaml>=5.1