コード例 #1
0
    # 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')
#             alarm.reset()


    time.sleep(0.1)