environment/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py
def bind_kernel(self, **kwargs):
        """Promote engine to listening kernel, accessible to frontends."""
        if self.kernel_app is not None:
            return
        
        self.log.info("Opening ports for direct connections as an IPython kernel")
        
        kernel = self.kernel
        
        kwargs.setdefault('config', self.config)
        kwargs.setdefault('log', self.log)
        kwargs.setdefault('profile_dir', self.profile_dir)
        kwargs.setdefault('session', self.engine.session)
        
        app = self.kernel_app = IPKernelApp(**kwargs)
        
        # allow IPKernelApp.instance():
        IPKernelApp._instance = app
        
        app.init_connection_file()
        # relevant contents of init_sockets:
        
        app.shell_port = app._bind_socket(kernel.shell_streams[0], app.shell_port)
        app.log.debug("shell ROUTER Channel on port: %i", app.shell_port)
        
        app.iopub_port = app._bind_socket(kernel.iopub_socket, app.iopub_port)
        app.log.debug("iopub PUB Channel on port: %i", app.iopub_port)
        
        kernel.stdin_socket = self.engine.context.socket(zmq.ROUTER)
        app.stdin_port = app._bind_socket(kernel.stdin_socket, app.stdin_port)
        app.log.debug("stdin ROUTER Channel on port: %i", app.stdin_port)
        
        # start the heartbeat, and log connection info:
        
        app.init_heartbeat()
        
        app.log_connection_info()
        app.write_connection_file()
def bind_kernel(self, **kwargs):
        if self.kernel_app is not None:
            return
        
        self.log.info("Opening ports for direct connections as an IPython kernel")
        
        kernel = self.kernel
        
        kwargs.setdefault('config', self.config)
        kwargs.setdefault('log', self.log)
        kwargs.setdefault('profile_dir', self.profile_dir)
        kwargs.setdefault('session', self.engine.session)
        
        app = self.kernel_app = IPKernelApp(**kwargs)
        
        # allow IPKernelApp.instance():
        IPKernelApp._instance = app
        
        app.init_connection_file()
        # relevant contents of init_sockets:
        
        app.shell_port = app._bind_socket(kernel.shell_streams[0], app.shell_port)
        app.log.debug("shell ROUTER Channel on port: %i", app.shell_port)
        
        app.iopub_port = app._bind_socket(kernel.iopub_socket, app.iopub_port)
        app.log.debug("iopub PUB Channel on port: %i", app.iopub_port)
        
        kernel.stdin_socket = self.engine.context.socket(zmq.ROUTER)
        app.stdin_port = app._bind_socket(kernel.stdin_socket, app.stdin_port)
        app.log.debug("stdin ROUTER Channel on port: %i", app.stdin_port)
        
        # start the heartbeat, and log connection info:
        
        app.init_heartbeat()
        
        app.log_connection_info()
        app.write_connection_file()
def bind_kernel ( self , * * kwargs ) : if self . kernel_app is not None : return self . log . info ( "Opening ports for direct connections as an IPython kernel" ) kernel = self . kernel kwargs . setdefault ( 'config' , self . config ) kwargs . setdefault ( 'log' , self . log ) kwargs . setdefault ( 'profile_dir' , self . profile_dir ) kwargs . setdefault ( 'session' , self . engine . session ) app = self . kernel_app = IPKernelApp ( * * kwargs ) # allow IPKernelApp.instance(): IPKernelApp . _instance = app app . init_connection_file ( ) # relevant contents of init_sockets: app . shell_port = app . _bind_socket ( kernel . shell_streams [ 0 ] , app . shell_port ) app . log . debug ( "shell ROUTER Channel on port: %i" , app . shell_port ) app . iopub_port = app . _bind_socket ( kernel . iopub_socket , app . iopub_port ) app . log . debug ( "iopub PUB Channel on port: %i" , app . iopub_port ) kernel . stdin_socket = self . engine . context . socket ( zmq . ROUTER ) app . stdin_port = app . _bind_socket ( kernel . stdin_socket , app . stdin_port ) app . log . debug ( "stdin ROUTER Channel on port: %i" , app . stdin_port ) # start the heartbeat, and log connection info: app . init_heartbeat ( ) app . log_connection_info ( ) app . write_connection_file ( )
Promote engine to listening kernel, accessible to frontends.
Promote engine to listening kernel accessible to frontends .