Source code for acq400_hapi.cleanup

import signal
import time

[docs]def sleep(secs): print("sleep(%.2f)" % (secs)) time.sleep(secs)
[docs]class ExitCommand(Exception): pass
[docs]def signal_handler(signal, frame): raise ExitCommand()
[docs]def init(): signal.signal(signal.SIGINT, signal_handler)