def install_shutdown_handlers(function, override_sigint=True):
 reactor._handleSignals()
 signal.signal(signal.SIGTERM, function)
 if ((signal.getsignal(signal.SIGINT) == signal.default_int_handler) or override_sigint):
  signal.signal(signal.SIGINT, function)
 if hasattr(signal, 'SIGBREAK'):
  signal.signal(signal.SIGBREAK, function)

def install_shutdown_handlers ( function , override_sigint = True ) : reactor . _handleSignals ( ) signal . signal ( signal . SIGTERM , function ) if ( ( signal . getsignal ( signal . SIGINT ) == signal . default_int_handler ) or override_sigint ) : signal . signal ( signal . SIGINT , function ) if hasattr ( signal , 'SIGBREAK' ) : signal . signal ( signal . SIGBREAK , function )
install the given function as a signal handler for all common shutdown signals .