def testGetLexerList(self): """Test getting the list of available languages""" langs = syntax.GetLexerList() self.assertTrue(isinstance(langs, list)) self.assertTrue(synglob.LANG_PYTHON in langs) for lang in langs: self.assertTrue(isinstance(lang, basestring))
def __DoLayout(self): """Layout the Panel""" # Create the ControlBar cbar = self.CreateControlBar(wx.TOP) # Setup the ControlBar's controls lexer_lbl = wx.StaticText(cbar, label=_("Preview File") + u": ") lexer_lst = wx.Choice(cbar, ed_glob.ID_LEXER, choices=syntax.GetLexerList()) lexer_lst.SetToolTip(wx.ToolTip(_("Set the preview file type"))) lexer_lst.SetStringSelection(u"CPP") cbar.AddControl(lexer_lbl) cbar.AddControl(lexer_lst) self.SetWindow(self.preview)