dev-python/documentex: add debug variable

DavidD 5 years ago
parent 62b71c2467
commit 54def127e4

@ -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"

@ -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

Loading…
Cancel
Save