if consigne is None

This commit is contained in:
root 2023-03-26 16:56:40 +00:00
parent 229f2097fd
commit c0dc5c7be3
1 changed files with 4 additions and 4 deletions

View File

@ -17,13 +17,13 @@ MAX_LENGTH = {
def Csv_generator(path, nb_in_serie, nb_page, police, consigne, writer):
exo_exemple = generate_from_path(path, 1, 'csv')
if len(consigne) < MAX_LENGTH[police] and len(consigne) > len(exo_exemple):
if consigne is not None and len(consigne) < MAX_LENGTH[police] and len(consigne) > len(exo_exemple):
longueur_max = len(consigne) + 5
elif len(consigne) > MAX_LENGTH[police] and len(consigne) > len(exo_exemple):
elif consigne is not None and len(consigne) > MAX_LENGTH[police] and len(consigne) > len(exo_exemple):
longueur_max = MAX_LENGTH[police]
elif len(consigne) > MAX_LENGTH[police] and len(consigne) < len(exo_exemple):
elif consigne is not None and len(consigne) > MAX_LENGTH[police] and len(consigne) < len(exo_exemple):
longueur_max = len(exo_exemple)
elif len(consigne) < MAX_LENGTH[police] and len(consigne) < len(exo_exemple):
elif consigne is not None and len(consigne) < MAX_LENGTH[police] and len(consigne) < len(exo_exemple):
longueur_max = len(exo_exemple)
else:
longueur_max = len(exo_exemple)