def update_ko_1(): if ko_note_1_var.get() in [ "п12мм12мо12", "п1212мм1212мо1212", "п2мм2мо2", "п22мм22мо22" ]: ko_note_1_var.set("пмммо") elif ko_note_1_var.get() in [ "п12мм12мо12мМ", "п2мм2мо2мМ", "п12мм12мо12мМ12", "п2мм2мо2мМ2", ]: ko_note_1_var.set("пмммомМ") json_in_memory["kan_otb_note_1"] = ko_note_1_var.get() json_in_memory["kan_otb_time_1"] = get_current_time() ko_1_var.set(json_in_memory["kan_otb_time_1"]) savejson()
def check_colors(): green_tk = Tkinter.color(200, 255, 200) yellow_tk = Tkinter.color(255, 255, 200) red_tk = Tkinter.color(255, 200, 200) if last_lo_var.get() == get_safe_time(): last_lo_entry.configure(bg=green_tk) elif int(last_lo_var.get()[:2]) - int(get_safe_time()[:2]) <= -2: last_lo_entry.configure(bg=red_tk) elif int(last_lo_var.get()[:2]) - int(get_safe_time()[:2]) >= 2: last_lo_entry.configure(bg=red_tk) else: last_lo_entry.configure(bg=yellow_tk) pass if last_batch_var.get() == get_safe_time(): last_batch_entry.configure(bg=green_tk) elif int(last_batch_var.get()[:2]) - int(get_safe_time()[:2]) <= -2: last_batch_entry.configure(bg=red_tk) elif int(last_batch_var.get()[:2]) - int(get_safe_time()[:2]) >= 2: last_batch_entry.configure(bg=red_tk) else: last_batch_entry.configure(bg=yellow_tk) pass if last_onebyone_var.get() == get_safe_time(): last_onebyone_entry.configure(bg=green_tk) elif int(last_onebyone_var.get()[:2]) - int(get_safe_time()[:2]) <= -2: last_onebyone_entry.configure(bg=red_tk) elif int(last_onebyone_var.get()[:2]) - int(get_safe_time()[:2]) >= 2: last_onebyone_entry.configure(bg=red_tk) else: last_onebyone_entry.configure(bg=yellow_tk) pass if Str.get_integers(ko_1_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_1_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_1_entry.configure(bg=green_tk) else: ko_note_1_entry.configure(bg=yellow_tk) else: ko_note_1_entry.configure(bg=red_tk) if Str.get_integers(ko_2_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_2_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_2_entry.configure(bg=green_tk) else: ko_note_2_entry.configure(bg=yellow_tk) else: ko_note_2_entry.configure(bg=red_tk) if Str.get_integers(ko_3_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_3_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_3_entry.configure(bg=green_tk) else: ko_note_3_entry.configure(bg=yellow_tk) else: ko_note_3_entry.configure(bg=red_tk) if Str.get_integers(ko_4_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_4_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_4_entry.configure(bg=green_tk) else: ko_note_4_entry.configure(bg=yellow_tk) else: ko_note_4_entry.configure(bg=red_tk) if Str.get_integers(ko_5_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_5_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_5_entry.configure(bg=green_tk) else: ko_note_5_entry.configure(bg=yellow_tk) else: ko_note_5_entry.configure(bg=red_tk) if Str.get_integers(ko_10_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_10_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_10_entry.configure(bg=green_tk) else: ko_note_10_entry.configure(bg=yellow_tk) else: ko_note_10_entry.configure(bg=red_tk) if Str.get_integers(ko_fp_var.get())[0] == Str.get_integers( get_current_time())[0]: if Str.get_integers(ko_fp_var.get())[3] == Str.get_integers( get_current_time())[3]: ko_note_fp_entry.configure(bg=green_tk) else: ko_note_fp_entry.configure(bg=yellow_tk) else: ko_note_fp_entry.configure(bg=red_tk)