mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 16:44:16 +02:00
[api.abstract.controller] refactoring: updating 'get_settings' return specification
This commit is contained in:
@@ -4,7 +4,7 @@ import shutil
|
|||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Set, Type, Tuple, Optional, Generator
|
from typing import List, Set, Type, Tuple, Optional
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ class SoftwareManager(ABC):
|
|||||||
"""
|
"""
|
||||||
pass
|
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_width
|
||||||
:param screen_height
|
:param screen_height
|
||||||
|
|||||||
@@ -823,7 +823,7 @@ class AppImageManager(SoftwareManager):
|
|||||||
print(f'{Fore.RED}[bauh][appimage] An exception has happened when deleting {f}{Fore.RESET}')
|
print(f'{Fore.RED}[bauh][appimage] An exception has happened when deleting {f}{Fore.RESET}')
|
||||||
traceback.print_exc()
|
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()
|
appimage_config = self.configman.get_config()
|
||||||
max_width = floor(screen_width * 0.15)
|
max_width = floor(screen_width * 0.15)
|
||||||
|
|
||||||
|
|||||||
@@ -2803,7 +2803,7 @@ class ArchManager(SoftwareManager):
|
|||||||
id_=id_,
|
id_=id_,
|
||||||
capitalize_label=capitalize_label)
|
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()
|
arch_config = self.configman.get_config()
|
||||||
max_width = floor(screen_width * 0.25)
|
max_width = floor(screen_width * 0.25)
|
||||||
|
|
||||||
|
|||||||
@@ -591,7 +591,7 @@ class FlatpakManager(SoftwareManager):
|
|||||||
|
|
||||||
return urls
|
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 = []
|
fields = []
|
||||||
|
|
||||||
flatpak_config = self.configman.get_config()
|
flatpak_config = self.configman.get_config()
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ class SnapManager(SoftwareManager):
|
|||||||
def get_screenshots(self, pkg: SnapApplication) -> List[str]:
|
def get_screenshots(self, pkg: SnapApplication) -> List[str]:
|
||||||
return pkg.screenshots if pkg.has_screenshots() else []
|
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()
|
snap_config = self.configman.get_config()
|
||||||
max_width = 200
|
max_width = 200
|
||||||
|
|
||||||
|
|||||||
@@ -1002,7 +1002,7 @@ class WebApplicationManager(SoftwareManager):
|
|||||||
print('{}[bauh][web] An exception has happened when deleting {}{}'.format(Fore.RED, ENV_PATH, Fore.RESET))
|
print('{}[bauh][web] An exception has happened when deleting {}{}'.format(Fore.RED, ENV_PATH, Fore.RESET))
|
||||||
traceback.print_exc()
|
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()
|
web_config = self.configman.get_config()
|
||||||
max_width = floor(screen_width * 0.15)
|
max_width = floor(screen_width * 0.15)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user