def signal_handler(signal, frame): try: GenNotify.Close() Queue.Close() except Exception as e1: log.error("signal_handler: " + str(e1)) sys.exit(0)
def signal_handler(signal, frame): try: GenNotify.Close() SMS.Close() except: pass sys.exit(0)
def signal_handler(signal, frame): GenNotify.Close() sys.exit(0)
console, ConfigFilePath, address, port, loglocation, log = MySupport.SetupAddOnProgram( "gensyslog") # Set the signal handler signal.signal(signal.SIGINT, signal_handler) try: GenNotify = GenNotify(host=address, port=port, onready=OnReady, onexercise=OnExercise, onrun=OnRun, onrunmanual=OnRunManual, onalarm=OnAlarm, onservice=OnService, onoff=OnOff, onmanual=OnManual, onutilitychange=OnUtilityChange, log=log, loglocation=loglocation, console=console) while True: time.sleep(1) except Exception as e1: log.error("Error: " + str(e1)) console.error("Error: " + str(e1))
os.path.join(ConfigFilePath, 'genpushover.conf') + ": " + str(e1)) sys.exit(1) try: Queue = MyMsgQueue(config=config, log=log, callback=SendNotice) GenNotify = GenNotify(host=address, port=port, onready=OnReady, onexercise=OnExercise, onrun=OnRun, onrunmanual=OnRunManual, onalarm=OnAlarm, onservice=OnService, onoff=OnOff, onmanual=OnManual, onutilitychange=OnUtilityChange, onsoftwareupdate=OnSoftwareUpdate, onsystemhealth=OnSystemHealth, onfuelstate=OnFuelState, log=log, loglocation=loglocation, console=console, config=config) while True: time.sleep(1) except Exception as e1: log.error("Error: " + GetErrorLine() + ": " + str(e1)) console.error("Error: " + str(e1))