environment/lib/python2.7/site-packages/IPython/frontend/html/notebook/notebookapp.py
def _confirm_exit(self):
        """confirm shutdown on ^C
        
        A second ^C, or answering 'y' within 5s will cause shutdown,
        otherwise original SIGINT handler will be restored.
        
        This doesn't work on Windows.
        """
        # FIXME: remove this delay when pyzmq dependency is >= 2.1.11
        time.sleep(0.1)
        sys.stdout.write("Shutdown Notebook Server (y/[n])? ")
        sys.stdout.flush()
        r,w,x = select.select([sys.stdin], [], [], 5)
        if r:
            line = sys.stdin.readline()
            if line.lower().startswith('y'):
                self.log.critical("Shutdown confirmed")
                ioloop.IOLoop.instance().stop()
                return
        else:
            print "No answer for 5s:",
        print "resuming operation..."
        # no answer, or answer is no:
        # set it back to original SIGINT handler
        # use IOLoop.add_callback because signal.signal must be called
        # from main thread
        ioloop.IOLoop.instance().add_callback(self._restore_sigint_handler)
def _confirm_exit(self):
        # FIXME: remove this delay when pyzmq dependency is >= 2.1.11
        time.sleep(0.1)
        sys.stdout.write("Shutdown Notebook Server (y/[n])? ")
        sys.stdout.flush()
        r,w,x = select.select([sys.stdin], [], [], 5)
        if r:
            line = sys.stdin.readline()
            if line.lower().startswith('y'):
                self.log.critical("Shutdown confirmed")
                ioloop.IOLoop.instance().stop()
                return
        else:
            print "No answer for 5s:",
        print "resuming operation..."
        # no answer, or answer is no:
        # set it back to original SIGINT handler
        # use IOLoop.add_callback because signal.signal must be called
        # from main thread
        ioloop.IOLoop.instance().add_callback(self._restore_sigint_handler)
def _confirm_exit ( self ) : # FIXME: remove this delay when pyzmq dependency is >= 2.1.11 time . sleep ( 0.1 ) sys . stdout . write ( "Shutdown Notebook Server (y/[n])? " ) sys . stdout . flush ( ) r , w , x = select . select ( [ sys . stdin ] , [ ] , [ ] , 5 ) if r : line = sys . stdin . readline ( ) if line . lower ( ) . startswith ( 'y' ) : self . log . critical ( "Shutdown confirmed" ) ioloop . IOLoop . instance ( ) . stop ( ) return else : print "No answer for 5s:" , print "resuming operation..." # no answer, or answer is no: # set it back to original SIGINT handler # use IOLoop.add_callback because signal.signal must be called # from main thread ioloop . IOLoop . instance ( ) . add_callback ( self . _restore_sigint_handler )
confirm shutdown on ^C
        
        A second ^C, or answering 'y' within 5s will cause shutdown,
        otherwise original SIGINT handler will be restored.
        
        This doesn't work on Windows.
confirm shutdown on ^C A second ^C or answering y within 5s will cause shutdown otherwise original SIGINT handler will be restored . This doesn t work on Windows .