[view] improvement: displaying a tooltip with the missing dependencies for a supported packaging technology

This commit is contained in:
Vinicius Moreira
2021-11-22 15:48:48 -03:00
parent 5121bb40ef
commit c80845cde4
47 changed files with 525 additions and 47 deletions

View File

@@ -795,17 +795,23 @@ class WebApplicationManager(SoftwareManager):
def set_enabled(self, enabled: bool):
self.enabled = enabled
def can_work(self) -> bool:
if BS4_AVAILABLE and LXML_AVAILABLE:
config = self.configman.get_config()
use_system_env = config['environment']['system']
def can_work(self) -> Tuple[bool, Optional[str]]:
if not BS4_AVAILABLE:
return False, self.i18n['missing_dep'].format(dep=bold('python3-beautifulsoup4'))
if not use_system_env:
return True
if not LXML_AVAILABLE:
return False, self.i18n['missing_dep'].format(dep=bold('python3-lxml'))
return nativefier.is_available()
config = self.configman.get_config()
use_system_env = config['environment']['system']
return False
if not use_system_env:
return True, None
if not nativefier.is_available():
return False, self.i18n['missing_dep'].format(dep=bold('nativefier'))
return True, None
def requires_root(self, action: SoftwareAction, pkg: SoftwarePackage) -> bool:
return False