environment/lib/python2.7/site-packages/IPython/frontend/qt/console/mainwindow.py
def populate_all_magic_menu(self, listofmagic=None):
        """Clean "All Magics..." menu and repopulate it with `listofmagic`

        Parameters
        ----------
        listofmagic : string,
            repr() of a list of strings, send back by the kernel

        Notes
        -----
        `listofmagic`is a repr() of list because it is fed with the result of
        a 'user_expression'
        """
        for k,v in self._magic_menu_dict.items():
            v.clear()
        self.all_magic_menu.clear()


        protected_magic = set(["more","less","load_ext","pycat","loadpy","load","save","psource"])
        mlist=ast.literal_eval(listofmagic)
        for magic in mlist:
            cell = (magic['type'] == 'cell')
            name = magic['name']
            mclass = magic['class']
            if cell :
                prefix='%%'
            else :
                prefix='%'
            magic_menu = self._get_magic_menu(mclass)

            if name in protected_magic:
                suffix = '?'
            else :
                suffix = ''
            pmagic = '%s%s%s'%(prefix,name,suffix)

            xaction = QtGui.QAction(pmagic,
                self,
                triggered=self._make_dynamic_magic(pmagic)
                )
            magic_menu.addAction(xaction)
            self.all_magic_menu.addAction(xaction)
def populate_all_magic_menu(self, listofmagic=None):
        for k,v in self._magic_menu_dict.items():
            v.clear()
        self.all_magic_menu.clear()


        protected_magic = set(["more","less","load_ext","pycat","loadpy","load","save","psource"])
        mlist=ast.literal_eval(listofmagic)
        for magic in mlist:
            cell = (magic['type'] == 'cell')
            name = magic['name']
            mclass = magic['class']
            if cell :
                prefix='%%'
            else :
                prefix='%'
            magic_menu = self._get_magic_menu(mclass)

            if name in protected_magic:
                suffix = '?'
            else :
                suffix = ''
            pmagic = '%s%s%s'%(prefix,name,suffix)

            xaction = QtGui.QAction(pmagic,
                self,
                triggered=self._make_dynamic_magic(pmagic)
                )
            magic_menu.addAction(xaction)
            self.all_magic_menu.addAction(xaction)
def populate_all_magic_menu ( self , listofmagic = None ) : for k , v in self . _magic_menu_dict . items ( ) : v . clear ( ) self . all_magic_menu . clear ( ) protected_magic = set ( [ "more" , "less" , "load_ext" , "pycat" , "loadpy" , "load" , "save" , "psource" ] ) mlist = ast . literal_eval ( listofmagic ) for magic in mlist : cell = ( magic [ 'type' ] == 'cell' ) name = magic [ 'name' ] mclass = magic [ 'class' ] if cell : prefix = '%%' else : prefix = '%' magic_menu = self . _get_magic_menu ( mclass ) if name in protected_magic : suffix = '?' else : suffix = '' pmagic = '%s%s%s' % ( prefix , name , suffix ) xaction = QtGui . QAction ( pmagic , self , triggered = self . _make_dynamic_magic ( pmagic ) ) magic_menu . addAction ( xaction ) self . all_magic_menu . addAction ( xaction )
Clean "All Magics..." menu and repopulate it with `listofmagic`

        Parameters
        ----------
        listofmagic : string,
            repr() of a list of strings, send back by the kernel

        Notes
        -----
        `listofmagic`is a repr() of list because it is fed with the result of
        a 'user_expression'
Clean All Magics ... menu and repopulate it with listofmagic