def populate_all_magic_menu(self, listofmagic=None):
for k,v in self._magic_menu_dict.items():<EOL><INDENT>v.clear()<EOL><DEDENT>self.all_magic_menu.clear()<EOL>protected_magic = set(["<STR_LIT>","<STR_LIT>","<STR_LIT>","<STR_LIT>","<STR_LIT>","<STR_LIT>","<STR_LIT>","<STR_LIT>"])<EOL>mlist=ast.literal_eval(listofmagic)<EOL>for magic in mlist:<EOL><INDENT>cell = (magic['<STR_LIT:type>'] == '<STR_LIT>')<EOL>name = magic['<STR_LIT:name>']<EOL>mclass = magic['<STR_LIT:class>']<EOL>if cell :<EOL><INDENT>prefix='<STR_LIT>'<EOL><DEDENT>else :<EOL><INDENT>prefix='<STR_LIT:%>'<EOL><DEDENT>magic_menu = self._get_magic_menu(mclass)<EOL>if name in protected_magic:<EOL><INDENT>suffix = '<STR_LIT:?>'<EOL><DEDENT>else :<EOL><INDENT>suffix = '<STR_LIT>'<EOL><DEDENT>pmagic = '<STR_LIT>'%(prefix,name,suffix)<EOL>xaction = QtGui.QAction(pmagic,<EOL>self,<EOL>triggered=self._make_dynamic_magic(pmagic)<EOL>)<EOL>magic_menu.addAction(xaction)<EOL>self.all_magic_menu.addAction(xaction)<EOL><DEDENT>
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'