Integrate claude, improve selenium and support qemu #1

Open
mathben wants to merge 224 commits from develop into master
2 changed files with 47 additions and 31 deletions
Showing only changes of commit c140b418d5 - Show all commits

View file

@ -1384,17 +1384,40 @@ class TODO:
print(f"⚠ {msg}") print(f"⚠ {msg}")
def _qemu_choose_cli_browser(self): def _qemu_choose_cli_browser(self):
"""Offre la LISTE des navigateurs CLI installés (ou propose d'en """Offre la LISTE des navigateurs CLI installés, plus une option pour
installer un) et renvoie celui choisi, sinon None.""" en INSTALLER un autre, et renvoie celui choisi, sinon None."""
from script.todo.qemu_install_monitor import CLI_BROWSERS
available = [b for b in CLI_BROWSERS if shutil.which(b)]
if not available:
return self._qemu_install_cli_browser()
print(f"\n{t('Which browser to view the page?')}")
for i, b in enumerate(available, 1):
print(f" [{i}] {b}{' *' if i == 1 else ''}")
print(f" [i] {t('Install another browser')}")
sel = input(t("Choice (number, blank = first): ")).strip().lower()
if sel == "i":
return self._qemu_install_cli_browser()
if not sel:
return available[0]
try:
idx = int(sel) - 1
if 0 <= idx < len(available):
return available[idx]
except ValueError:
pass
return available[0]
def _qemu_install_cli_browser(self):
"""Demande QUEL navigateur CLI installer, affiche la commande adaptée
à l'OS, l'exécute après validation. Renvoie le binaire installé ou
None."""
from script.todo.qemu_install_monitor import ( from script.todo.qemu_install_monitor import (
CLI_BROWSERS,
INSTALLABLE_BROWSERS, INSTALLABLE_BROWSERS,
browser_install_command, browser_install_command,
) )
available = [b for b in CLI_BROWSERS if shutil.which(b)] print(f"\n{t('Which browser to install?')}")
if not available:
print(t("No CLI browser installed. Which to install?"))
for i, (b, desc) in enumerate(INSTALLABLE_BROWSERS, 1): for i, (b, desc) in enumerate(INSTALLABLE_BROWSERS, 1):
print(f" [{i}] {desc}{' *' if i == 1 else ''}") print(f" [{i}] {desc}{' *' if i == 1 else ''}")
sel = input(t("Choice (number, blank = w3m): ")).strip() sel = input(t("Choice (number, blank = w3m): ")).strip()
@ -1415,21 +1438,6 @@ class TODO:
return None return None
os.system(printable) os.system(printable)
return browser if shutil.which(browser) else None return browser if shutil.which(browser) else None
if len(available) == 1:
return available[0]
print(f"\n{t('Which browser to view the page?')}")
for i, b in enumerate(available, 1):
print(f" [{i}] {b}{' *' if i == 1 else ''}")
sel = input(t("Choice (number, blank = first): ")).strip()
if not sel:
return available[0]
try:
idx = int(sel) - 1
if 0 <= idx < len(available):
return available[idx]
except ValueError:
pass
return available[0]
# ------------------------------------------------------------------ # # ------------------------------------------------------------------ #
# Redimensionnement du disque d'une VM # Redimensionnement du disque d'une VM

View file

@ -1448,6 +1448,14 @@ TRANSLATIONS = {
"fr": "Aucun navigateur CLI installé. Lequel installer ?", "fr": "Aucun navigateur CLI installé. Lequel installer ?",
"en": "No CLI browser installed. Which to install?", "en": "No CLI browser installed. Which to install?",
}, },
"Which browser to install?": {
"fr": "Quel navigateur installer ?",
"en": "Which browser to install?",
},
"Install another browser": {
"fr": "Installer un autre navigateur",
"en": "Install another browser",
},
"Choice (number, blank = w3m): ": { "Choice (number, blank = w3m): ": {
"fr": "Choix (numéro, vide = w3m) : ", "fr": "Choix (numéro, vide = w3m) : ",
"en": "Choice (number, blank = w3m): ", "en": "Choice (number, blank = w3m): ",