def signal_handler(signal, frame): global init_ok init_ok = False commands.doCleanup() webserver.WebServer.stop() gpios.HWPorts.cleanup() time.sleep(1) print("\nProgram exiting gracefully") sys.exit(0)
def signal_handler(self, signal, frame): # backup handler, defined at RPIEasy.py originally import webserver import commands try: import gpios except Exception as e: pass commands.doCleanup() webserver.WebServer.stop() try: gpios.HWPorts.cleanup() except: pass time.sleep(1) print("\nProgram exiting gracefully") sys.exit(0)