Fix: comportement dans le cas où il n'y a pas encore de séquence
This commit is contained in:
parent
951f04dfdf
commit
79acc41dd7
11
tasks.py
11
tasks.py
@ -75,8 +75,14 @@ def sequence_prompt(
|
||||
)
|
||||
|
||||
sequences = get_sequences(sequence["tribe"])
|
||||
print("Séquences trouvées:\n\t" + "\n\t".join(sorted([s.name for s in sequences])))
|
||||
sequence["num"] = max([int(seq.name[0:2]) for seq in sequences]) + 1
|
||||
if sequences:
|
||||
print("Séquences trouvées:\n\t" +
|
||||
"\n\t".join(sorted([s.name for s in sequences])))
|
||||
sequence["num"] = max([int(seq.name[0:2]) for seq in sequences]) + 1
|
||||
else:
|
||||
print("Pas de séquence trouvée")
|
||||
sequence["num"] = 1
|
||||
|
||||
sequence["title"] = prompt(
|
||||
f"Nom de la séquence (n°{sequence['num']}): ", default=title
|
||||
)
|
||||
@ -147,4 +153,3 @@ def sequence(c):
|
||||
|
||||
sequence["title_under"] = "#" * len(sequence["title"])
|
||||
import_skel(dest, sequence, "sequence")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user