environment/lib/python2.7/site-packages/IPython/lib/demo.py
def edit(self,index=None):
        """Edit a block.

        If no number is given, use the last block executed.

        This edits the in-memory copy of the demo, it does NOT modify the
        original source file.  If you want to do that, simply open the file in
        an editor and use reload() when you make changes to the file.  This
        method is meant to let you change a block during a demonstration for
        explanatory purposes, without damaging your original script."""

        index = self._get_index(index)
        if index is None:
            return
        # decrease the index by one (unless we're at the very beginning), so
        # that the default demo.edit() call opens up the sblock we've last run
        if index>0:
            index -= 1

        filename = self.shell.mktempfile(self.src_blocks[index])
        self.shell.hooks.editor(filename,1)
        new_block = file_read(filename)
        # update the source and colored block
        self.src_blocks[index] = new_block
        self.src_blocks_colored[index] = self.ip_colorize(new_block)
        self.block_index = index
        # call to run with the newly edited index
        self()
def edit(self,index=None):
        index = self._get_index(index)
        if index is None:
            return
        # decrease the index by one (unless we're at the very beginning), so
        # that the default demo.edit() call opens up the sblock we've last run
        if index>0:
            index -= 1

        filename = self.shell.mktempfile(self.src_blocks[index])
        self.shell.hooks.editor(filename,1)
        new_block = file_read(filename)
        # update the source and colored block
        self.src_blocks[index] = new_block
        self.src_blocks_colored[index] = self.ip_colorize(new_block)
        self.block_index = index
        # call to run with the newly edited index
        self()
def edit ( self , index = None ) : index = self . _get_index ( index ) if index is None : return # decrease the index by one (unless we're at the very beginning), so # that the default demo.edit() call opens up the sblock we've last run if index > 0 : index -= 1 filename = self . shell . mktempfile ( self . src_blocks [ index ] ) self . shell . hooks . editor ( filename , 1 ) new_block = file_read ( filename ) # update the source and colored block self . src_blocks [ index ] = new_block self . src_blocks_colored [ index ] = self . ip_colorize ( new_block ) self . block_index = index # call to run with the newly edited index self ( )
Edit a block.

        If no number is given, use the last block executed.

        This edits the in-memory copy of the demo, it does NOT modify the
        original source file.  If you want to do that, simply open the file in
        an editor and use reload() when you make changes to the file.  This
        method is meant to let you change a block during a demonstration for
        explanatory purposes, without damaging your original script.
Edit a block .