def main(): root = Tk() a = Alarm(root) a.pack(side="bottom") textbox = Entry(root) textbox.pack(side="left") start = Button(root, text="Start",command= lambda: a.startTimer(int(textbox.get()), start, stop, textbox)) start.pack(side="left") stop = Button(root, text="Stop",command= lambda: a.stop(start,stop)) stop.config(state="disabled") stop.pack(side="left") reset = Button(root, text="Reset", command= lambda: a.reset(start,stop,textbox)) reset.pack(side="left") root.mainloop()
os.system('/www/site/run_vol_up.sh') # Volume Down if os.path.isfile(FileMusicDown): print('>Server: Signal Music Down') os.remove(FileMusicDown); os.system('/www/site/run_vol_dwn.sh') # Testing sound level if os.path.isfile(FileTestSound): print('>Server: Signal Test Sound') os.remove(FileTestSound); try: alarm.test_sound_level(); except Exception as e: logit('ERROR') alarm.reset() # Setting alarm if os.path.isfile(FileAlarmSet): print('>Server: Signal Setting alarm') os.remove(FileAlarmSet); try: alarm.setFromFile() except Exception as e: logit('ERROR') alarm.reset() # Launching alarm if alarm.isTime(): # try: alarm.now(); # except Exception as e: # logit('ERROR')