[web] feature -> new installation option 'allow protected content'

This commit is contained in:
Vinicius Moreira
2020-12-07 18:18:38 -03:00
parent 358d704149
commit 8d761c35e9
19 changed files with 127 additions and 51 deletions

View File

@@ -106,7 +106,7 @@ class SoftwareManager(ABC):
pass
@abstractmethod
def read_installed(self, disk_loader: DiskCacheLoader, limit: int, only_apps: bool, pkg_types: Set[Type[SoftwarePackage]], internet_available: bool) -> SearchResult:
def read_installed(self, disk_loader: Optional[DiskCacheLoader], limit: int, only_apps: bool, pkg_types: Set[Type[SoftwarePackage]], internet_available: bool) -> SearchResult:
"""
:param disk_loader: a running disk loader thread that loads application data from the disk asynchronously
:param limit: the max number of packages to be retrieved. <= 1 should retrieve everything
@@ -234,7 +234,7 @@ class SoftwareManager(ABC):
if pkg.supports_disk_cache():
self.serialize_to_disk(pkg, icon_bytes, only_icon)
def serialize_to_disk(self, pkg: SoftwarePackage, icon_bytes: bytes, only_icon: bool):
def serialize_to_disk(self, pkg: SoftwarePackage, icon_bytes: Optional[bytes], only_icon: bool):
"""
Sames as above, but does not check if disk cache is enabled or supported by the package instance
:param pkg:

View File

@@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Tuple, Optional
from bauh.api.abstract.view import MessageType, ViewComponent
@@ -17,7 +17,7 @@ class ProcessWatcher:
"""
pass
def request_confirmation(self, title: str, body: str, components: List[ViewComponent] = None, confirmation_label: str = None,
def request_confirmation(self, title: str, body: Optional[str], components: List[ViewComponent] = None, confirmation_label: str = None,
deny_label: str = None, deny_button: bool = True, window_cancel: bool = False,
confirmation_button: bool = True) -> bool:
"""
@@ -95,11 +95,11 @@ class TaskManager:
"""
pass
def update_progress(self, task_id: str, progress: float, substatus: str):
def update_progress(self, task_id: str, progress: float, substatus: Optional[str]):
"""
:param task_id:
:param progress: a float between 0 and 100.
:param substatus: a substatus string representing the current state
:param substatus: optional substatus string representing the current state
:return:
"""
pass

View File

@@ -108,7 +108,7 @@ class SingleSelectComponent(InputViewComponent):
class MultipleSelectComponent(InputViewComponent):
def __init__(self, label: str, options: List[InputOption], default_options: Set[InputOption] = None,
def __init__(self, label: Optional[str], options: List[InputOption], default_options: Set[InputOption] = None,
max_per_line: int = 1, tooltip: str = None, spaces: bool = True, max_width: int = -1,
max_height: int = -1, id_: str = None):
super(MultipleSelectComponent, self).__init__(id_=id_)