erplibre/script/todo
Mathieu Benoit 55f6127a72 [FIX] todo: un PostgreSQL injoignable proposait sa trace d'appel comme base
« db --list » rendait un code de retour que personne ne lisait. Comme la sortie
et l'erreur passent par le même flux (stderr=STDOUT, execute.py), les lignes de
la trace d'appel devenaient les entrées du menu :

  [1] Traceback (most recent call last):
  [2]   File "…/odoo-bin", line 8, in <module>
  [0] Retour

Choisir [1] renvoyait « Traceback (most recent call last): » comme nom de base à
l'appelant, qui le passait à sa commande — sauvegarde, restauration, shell. Le
code de retour était pourtant là, 120, dans la variable « status », écrasée deux
lignes plus bas par la réponse de click.prompt.

Le contrôle se fait donc AVANT de construire le menu : code non nul, on affiche
les dernières lignes de l'erreur réelle et on rend False. Une liste vide dit
aussi ce qu'elle est, au lieu d'un écran ne portant que « Retour ».

Au passage, la branche de saisie invalide appelait t("cmd_not_found") — une clé
absente de TRANSLATIONS, donc affichée telle quelle, en anglais technique. Les
autres menus disent t("Command not found !") ; celui-ci le dit maintenant aussi.

« quiet=True » s'ajoute parce que la sortie brute n'a plus de raison d'être vue :
le menu affiche la liste, et en cas d'échec c'est l'erreur qui est montrée.

Vérifié sur les quatre chemins, PGPORT=1 pour simuler la panne : injoignable
rend False sans afficher un seul menu ; [0] rend False ; [1] rend « test » ; une
saisie invalide affiche un message traduit dans les deux langues.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 08:03:42 +00:00
..
database_manager.py [FIX] todo: un PostgreSQL injoignable proposait sa trace d'appel comme base 2026-08-03 08:03:42 +00:00
kdbx_manager.py [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
logo_ascii.txt [IMP] bot assistant TODO 2025-04-27 02:40:20 -04:00
migration_form.py [ADD] migration: a TUI resume screen, same first question as the prompt 2026-08-01 06:38:31 -04:00
migration_stats.py [ADD] migration: a read-only statistics screen, and a way out 2026-08-02 03:16:50 -04:00
qemu_deploy_form.py [FIX] qemu form: tick nothing in the catalog by default 2026-08-01 06:27:25 -04:00
qemu_install_monitor.py [ADD] qemu: statistics screen, with reset — and record failures too 2026-08-01 05:16:27 -04:00
README.base.md [ADD] Multilingual translation of all documentation (EN/FR) 2026-03-04 22:23:52 -05:00
README.fr.md [ADD] Multilingual translation of all documentation (EN/FR) 2026-03-04 22:23:52 -05:00
README.md [ADD] Multilingual translation of all documentation (EN/FR) 2026-03-04 22:23:52 -05:00
source_todo.sh [UPD] TODO: auto installation 2025-10-31 01:33:34 -04:00
textual_setup.py [IMP] todo: offer to install textual instead of just naming it 2026-08-03 02:42:52 -04:00
todo.json [IMP] script todo: add QEMU/KVM VM deploy menu 2026-07-15 11:48:12 +00:00
todo.py [IMP] qemu ssh: ask about the key when SSH refuses, not before 2026-08-03 02:49:35 -04:00
todo_example.json [UPD] TODO: simplify code by reusing method and support same command 2025-04-28 00:35:27 -04:00
todo_file_browser.py [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
todo_i18n.py [FIX] todo: un PostgreSQL injoignable proposait sa trace d'appel comme base 2026-08-03 08:03:42 +00:00
todo_prefs.py [ADD] migration: a TUI resume screen, same first question as the prompt 2026-08-01 06:38:31 -04:00
todo_telemetry.py [FIX] télémétrie navigation : extraire les commandes des menus « choices » 2026-07-30 23:24:40 -04:00
todo_upgrade.py [IMP] todo: offer to install textual instead of just naming it 2026-08-03 02:42:52 -04:00
version_manager.py [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00

TODO is an assistant robot to use ERPLibre Execute it with ./script/todo/todo.py or make todo.

For a new project, copy todo_example.json to private/todo/todo_override.json | private/todo/todo_override_private.json and edit it.