environment/lib/python2.7/site-packages/IPython/frontend/qt/console/rich_ipython_widget.py
def _context_menu_make(self, pos):
        """ Reimplemented to return a custom context menu for images.
        """
        format = self._control.cursorForPosition(pos).charFormat()
        name = format.stringProperty(QtGui.QTextFormat.ImageName)
        if name:
            menu = QtGui.QMenu()

            menu.addAction('Copy Image', lambda: self._copy_image(name))
            menu.addAction('Save Image As...', lambda: self._save_image(name))
            menu.addSeparator()

            svg = self._name_to_svg_map.get(name, None)
            if svg is not None:
                menu.addSeparator()
                menu.addAction('Copy SVG', lambda: svg_to_clipboard(svg))
                menu.addAction('Save SVG As...',
                               lambda: save_svg(svg, self._control))
        else:
            menu = super(RichIPythonWidget, self)._context_menu_make(pos)
        return menu
def _context_menu_make(self, pos):
        format = self._control.cursorForPosition(pos).charFormat()
        name = format.stringProperty(QtGui.QTextFormat.ImageName)
        if name:
            menu = QtGui.QMenu()

            menu.addAction('Copy Image', lambda: self._copy_image(name))
            menu.addAction('Save Image As...', lambda: self._save_image(name))
            menu.addSeparator()

            svg = self._name_to_svg_map.get(name, None)
            if svg is not None:
                menu.addSeparator()
                menu.addAction('Copy SVG', lambda: svg_to_clipboard(svg))
                menu.addAction('Save SVG As...',
                               lambda: save_svg(svg, self._control))
        else:
            menu = super(RichIPythonWidget, self)._context_menu_make(pos)
        return menu
def _context_menu_make ( self , pos ) : format = self . _control . cursorForPosition ( pos ) . charFormat ( ) name = format . stringProperty ( QtGui . QTextFormat . ImageName ) if name : menu = QtGui . QMenu ( ) menu . addAction ( 'Copy Image' , lambda : self . _copy_image ( name ) ) menu . addAction ( 'Save Image As...' , lambda : self . _save_image ( name ) ) menu . addSeparator ( ) svg = self . _name_to_svg_map . get ( name , None ) if svg is not None : menu . addSeparator ( ) menu . addAction ( 'Copy SVG' , lambda : svg_to_clipboard ( svg ) ) menu . addAction ( 'Save SVG As...' , lambda : save_svg ( svg , self . _control ) ) else : menu = super ( RichIPythonWidget , self ) . _context_menu_make ( pos ) return menu
Reimplemented to return a custom context menu for images.
Reimplemented to return a custom context menu for images .