def postaction(): ''' Actions à effectuer en sortie ''' name = saisie.get() if DEBUG: print("sortie:", saisie.get()) name_actif = sequence_active.name names = [seq.name for seq in liste_des_sequences] names = [n for n in names if n != name_actif] if name: if name in names: barre_de_message('Ce nom existe déjà', messager) else: barre_de_message('Séquence validée', messager) else: barre_de_message('Entrez un nom de séquence', messager) return None if sequence_active.is_invalide(): mess = 'Filtres incompatibles' barre_de_message(mess, messager) else : sequence_active.name = name barre_de_menu(lm_sequence, menu) liste_des_sequences.sort(key=lambda seq: seq.name) writesequences(liste_des_sequences) clear(fenetre)
def postaction(): global sequence_active barre_de_menu(lm_sequence, menu) _supprimer_sequence(sequence_active) writesequences(liste_des_sequences) barre_de_message(f'{sequence_active.name} effacée', messager) sequence_active = None clear(fenetre)
def c_reinitialiser_sequences(): global liste_des_sequences clear(fenetre) tk.Label(fenetre, text="Attention !").grid() tk.Label(fenetre, text="Vous allez effacer les séquences !").grid() tk.Label(fenetre, text="En cas de Bug uniquement !").grid() if askyesno(title='EFFACEMENT DES SEQUENCES', message='Continuer ?', parent=menu): liste_des_sequences = [] writesequences(liste_des_sequences) clear(fenetre)
def postaction(): global sequence_active ''' Actions à effectuer en sortie ''' names = [seq.name for seq in liste_des_sequences] name = saisie.get() if name in names: mess = "Ce nom existe déjà !" barre_de_message(mess, messager) else: sequence.name = name sequence_active = sequence barre_de_menu(lm_sequence, menu) liste_des_sequences.append(sequence) liste_des_sequences.sort(key=lambda seq: seq.name) writesequences(liste_des_sequences) clear(fenetre)
def postaction(): global sequence_active ''' Actions à effectuer en sortie ''' names = [seq.name for seq in liste_des_sequences] name = saisie.get() if name in names: mess = "Ce nom existe déjà !" barre_de_message(mess, messager) elif name == "": mess = 'Entrez un nom de séquence' barre_de_message(mess, messager) elif sequence.is_invalide(): mess = 'Filtres incompatibles' barre_de_message(mess, messager) else: sequence.name = name sequence_active = sequence barre_de_menu(lm_sequence, menu) liste_des_sequences.append(sequence) liste_des_sequences.sort(key=lambda seq: seq.name) writesequences(liste_des_sequences) clear(fenetre)