From 459240933a82def76a057541acb97e6c05678a09 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 30 Nov 2021 12:25:41 -0300 Subject: [PATCH] [api.abstract.controller] refactoring: updating 'get_settings' return specification --- bauh/api/abstract/controller.py | 4 ++-- bauh/gems/appimage/controller.py | 2 +- bauh/gems/arch/controller.py | 2 +- bauh/gems/flatpak/controller.py | 2 +- bauh/gems/snap/controller.py | 2 +- bauh/gems/web/controller.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bauh/api/abstract/controller.py b/bauh/api/abstract/controller.py index 1f805b11..d270340c 100644 --- a/bauh/api/abstract/controller.py +++ b/bauh/api/abstract/controller.py @@ -4,7 +4,7 @@ import shutil from abc import ABC, abstractmethod from enum import Enum from pathlib import Path -from typing import List, Set, Type, Tuple, Optional, Generator +from typing import List, Set, Type, Tuple, Optional import yaml @@ -368,7 +368,7 @@ class SoftwareManager(ABC): """ pass - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: """ :param screen_width :param screen_height diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 7dce12d8..2769ba30 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -823,7 +823,7 @@ class AppImageManager(SoftwareManager): print(f'{Fore.RED}[bauh][appimage] An exception has happened when deleting {f}{Fore.RESET}') traceback.print_exc() - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: appimage_config = self.configman.get_config() max_width = floor(screen_width * 0.15) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index ecc49b78..1e8329ed 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -2803,7 +2803,7 @@ class ArchManager(SoftwareManager): id_=id_, capitalize_label=capitalize_label) - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: arch_config = self.configman.get_config() max_width = floor(screen_width * 0.25) diff --git a/bauh/gems/flatpak/controller.py b/bauh/gems/flatpak/controller.py index 929ab211..fe171b9f 100644 --- a/bauh/gems/flatpak/controller.py +++ b/bauh/gems/flatpak/controller.py @@ -591,7 +591,7 @@ class FlatpakManager(SoftwareManager): return urls - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: fields = [] flatpak_config = self.configman.get_config() diff --git a/bauh/gems/snap/controller.py b/bauh/gems/snap/controller.py index 6674d49d..d2aca52b 100644 --- a/bauh/gems/snap/controller.py +++ b/bauh/gems/snap/controller.py @@ -443,7 +443,7 @@ class SnapManager(SoftwareManager): def get_screenshots(self, pkg: SnapApplication) -> List[str]: return pkg.screenshots if pkg.has_screenshots() else [] - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: snap_config = self.configman.get_config() max_width = 200 diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index df568865..76972514 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -1002,7 +1002,7 @@ class WebApplicationManager(SoftwareManager): print('{}[bauh][web] An exception has happened when deleting {}{}'.format(Fore.RED, ENV_PATH, Fore.RESET)) traceback.print_exc() - def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: + def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]: web_config = self.configman.get_config() max_width = floor(screen_width * 0.15)