[arch] improvement: allowing AUR packages to be installed as dependencies of a repository package | fix: not displaying all possible AUR providers for a given dependency

This commit is contained in:
Vinicius Moreira
2022-01-28 12:05:58 -03:00
parent f69ed7aa4a
commit ca9b3d0e51
14 changed files with 312 additions and 168 deletions

View File

@@ -1,4 +1,4 @@
from typing import Iterable
from typing import Iterable, Optional
from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.view import MessageType
@@ -13,11 +13,13 @@ def show_deps_not_installed(watcher: ProcessWatcher, pkgname: str, depnames: Ite
type_=MessageType.ERROR)
def show_dep_not_found(depname: str, i18n: I18n, watcher: ProcessWatcher):
def show_dep_not_found(depname: str, i18n: I18n, watcher: ProcessWatcher, dependent: Optional[str] = None):
body = '<p>{}</p><p>{}</p><p></p><p>{}</p>'.format(i18n['arch.install.dep_not_found.body.l1'].format(bold(depname)),
i18n['arch.install.dep_not_found.body.l2'],
i18n['arch.install.dep_not_found.body.l3'])
source = f" {bold('(' + dependent + ')')}" if dependent else ''
body = f"<p>{i18n['arch.install.dep_not_found.body.l1'].format(dep=bold(depname), source=source)}</p>" \
f"<p><{i18n['arch.install.dep_not_found.body.l2']}</p>" \
f"<p>{i18n['arch.install.dep_not_found.body.l3']}</p>"
watcher.show_message(title=i18n['arch.install.dep_not_found.title'].capitalize(),
body=body,