From 54def127e4965b5359a8d9e9edb7704c73a88899 Mon Sep 17 00:00:00 2001 From: DavidD Date: Sat, 1 Aug 2020 23:20:57 +0200 Subject: [PATCH] dev-python/documentex: add debug variable --- documentex/constantes_document_latex.py | 6 +++++- documentex/lib_nettoyage_argv.py | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/documentex/constantes_document_latex.py b/documentex/constantes_document_latex.py index a56f4b9..c622994 100644 --- a/documentex/constantes_document_latex.py +++ b/documentex/constantes_document_latex.py @@ -5,10 +5,14 @@ import jinja2 softname = 'documentex' """Nom du programme """ -version = '1.0' +version = '1.1' """Version du programme """ +debug = False +"""Debug variable +""" + classe_appartenance = "PT" promotion = "Fourier" lycee_appartenance = "Lycée Langevin Wallon" diff --git a/documentex/lib_nettoyage_argv.py b/documentex/lib_nettoyage_argv.py index 06d6eb6..fbd245c 100644 --- a/documentex/lib_nettoyage_argv.py +++ b/documentex/lib_nettoyage_argv.py @@ -9,6 +9,9 @@ def format(argv): arguments = argv.split('_') if len(arguments) == 1: arguments.append('') # garantit qu'il y a toujours au moins deux arguments, le second éventuellement vide + if constantes.debug: + print("fonction format") + print(f"La variable arguments est {arguments}") return arguments def bon_format(argv): @@ -18,6 +21,9 @@ def bon_format(argv): if len(arguments) != 2: # c'est impossible ? return False numero,titre = arguments + if constantes.debug: + print("fonction bon_format") + print(f"Les variables numero,titre sont {numero} et {titre}") try: int(numero) #si le numéro est bien un numéro return numero in constantes.numeros_admissibles