def __init__(self, parent): """Initialize the window""" super(StackThreadShelfWindow, self).__init__(parent) # Attributes self.prevstack = None self.current_thread = None self.threads_list = None bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS|eclib.SEGBOOK_STYLE_LEFT self._nb = eclib.SegmentBook(self, style=bstyle) self._stackframe = StackFrameList(self._nb) self._threads = ThreadsList(self._nb) # Setup self._InitImageList() self._nb.AddPage(self._stackframe, _("Stack Frame"), img_id=0) self._nb.AddPage(self._threads, _("Threads"), img_id=1) ctrlbar = self.setup(self._nb, self._stackframe, self._threads) ctrlbar.AddStretchSpacer() self.layout() # Debugger Attributes RpdbDebugger().clearframe = self.ClearStackList RpdbDebugger().selectframe = self._stackframe.select_frame RpdbDebugger().updatestacklist = self.UpdateStackList RpdbDebugger().clearthread = self.ClearThreadList RpdbDebugger().updatethread = self._threads.update_thread RpdbDebugger().updatethreadlist = self.UpdateThreadList RpdbDebugger().update_stack() current_thread, threads_list = RpdbDebugger().get_thread_list() self.UpdateThreadList(current_thread, threads_list)
def __init__(self, parent): """Initialize the window""" super(LintShelfWindow, self).__init__(parent) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LEFT self._nb = eclib.SegmentBook(self, style=bstyle) self._checkresultslist = CheckResultsList(self._nb) self._evaluation = EvaluationWindow(self._nb) # Setup self._InitImageList() self._nb.AddPage(self._checkresultslist, _("Warnings/Errors"), img_id=0) self._nb.AddPage(self._evaluation, _("Evaluation"), img_id=1) ctrlbar = self.setup(self._nb, self._checkresultslist, self._evaluation) ctrlbar.AddControl( wx.StaticLine(ctrlbar, size=(-1, 16), style=wx.LI_VERTICAL), wx.ALIGN_LEFT) self.savebtn = self.AddPlateButton(u"", ed_glob.ID_SAVE, wx.ALIGN_LEFT) self.savebtn.ToolTip = wx.ToolTip(_("Save Results")) self.openbtn = self.AddPlateButton(u"", ed_glob.ID_OPEN, wx.ALIGN_LEFT) self.openbtn.ToolTip = wx.ToolTip(_("Load Results")) self._lbl = wx.StaticText(ctrlbar) ctrlbar.AddControl(self._lbl) ctrlbar.AddStretchSpacer() self.layout("PyLint", self.OnRunLint, self.OnJobTimer) self.TaskButton.SetBitmap(Images.Lint.Bitmap) self.TaskButton.ToolTip = wx.ToolTip(_("Run Pylint Analysis")) self.formatbtn = self.AddPlateButton(_("Pep8"), Images.Lint.Bitmap, wx.ALIGN_RIGHT) self.formatbtn.ToolTip = wx.ToolTip(_("Run Pep8 Check")) self.clearbtn = self.AddPlateButton("", ed_glob.ID_DELETE, wx.ALIGN_RIGHT) self.clearbtn.ToolTip = wx.ToolTip(_("Clear")) # Attributes self._checker = None # Editra Message Handlers ed_msg.Subscribe(self.OnFileLoad, ed_msg.EDMSG_FILE_OPENED) ed_msg.Subscribe(self.OnFileSave, ed_msg.EDMSG_FILE_SAVED) ed_msg.Subscribe(self.OnPageChanged, ed_msg.EDMSG_UI_NB_CHANGED) # Event Handlers self.Bind(wx.EVT_BUTTON, self.OnSaveResults, self.savebtn) self.Bind(wx.EVT_BUTTON, self.OnOpenResults, self.openbtn) self.Bind(wx.EVT_BUTTON, self.OnChkFormat, self.formatbtn) self.Bind(wx.EVT_BUTTON, self.OnClear, self.clearbtn)
def __init__(self, parent, id=wx.ID_ANY, title=u'', size=wx.DefaultSize): wx.Frame.__init__(self, parent, title=title, size=size, style=wx.DEFAULT_FRAME_STYLE) util.SetWindowIcon(self) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LABELS self._nb = eclib.SegmentBook(self, style=bstyle) self._cfg_pg = ConfigPanel(self._nb, style=wx.BORDER_SUNKEN) self._dl_pg = DownloadPanel(self._nb) self._inst_pg = InstallPanel(self._nb) self._imglst = list() # Setup self._imglst.append(MakeThemeTool(ed_glob.ID_PREF)) self._imglst.append(MakeThemeTool(ed_glob.ID_WEB)) self._imglst.append(MakeThemeTool(ed_glob.ID_PACKAGE)) bmp = wx.ArtProvider.GetBitmap(wx.ART_ERROR, wx.ART_TOOLBAR, (32, 32)) self._imglst.append(bmp) bmp = wx.ArtProvider.GetBitmap(str(ed_glob.ID_PREF), wx.ART_TOOLBAR, (32, 32)) self._imglst.append(bmp) self._nb.SetImageList(self._imglst) self._nb.SetUsePyImageList(True) self._nb.AddPage(self._cfg_pg, _("Configure"), img_id=IMG_CONFIG) self._nb.AddPage(self._dl_pg, _("Download"), img_id=IMG_DOWNLOAD) self._nb.AddPage(self._inst_pg, _("Install"), img_id=IMG_INSTALL) # Check for plugins with error conditions and if any are found # Add the error page. pmgr = wx.GetApp().GetPluginManager() if len(pmgr.GetIncompatible()): self._nb.AddPage(ConfigPanel(self._nb, style=wx.BORDER_SUNKEN, mode=MODE_ERROR), _("Errors"), img_id=IMG_ERROR) # Layout sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self._nb, 1, wx.EXPAND) self.SetSizer(sizer) self.SetStatusBar(eclib.ProgressStatusBar(self, style=wx.SB_FLAT)) self.SetInitialSize(size) # Event Handlers self.Bind(eclib.EVT_SB_PAGE_CHANGING, self.OnPageChanging) self.Bind(wx.EVT_CLOSE, self.OnClose)
def __init__(self, parent, id=wx.ID_ANY, title=u'', size=wx.DefaultSize): super(PluginDialog, self).__init__(parent, title=title, size=size, style=wx.DEFAULT_FRAME_STYLE) util.SetWindowIcon(self) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LABELS self._nb = eclib.SegmentBook(self, style=bstyle) self._cfg_pg = ConfigPanel(self._nb, style=wx.BORDER_SUNKEN) self._dl_pg = DownloadPanel(self._nb) self._inst_pg = InstallPanel(self._nb) self._imglst = list() # Setup self.__InitImageList() self._nb.AddPage(self._cfg_pg, _("Configure"), img_id=IMG_CONFIG) self._nb.AddPage(self._dl_pg, _("Download"), img_id=IMG_DOWNLOAD) self._nb.AddPage(self._inst_pg, _("Install"), img_id=IMG_INSTALL) # Check for plugins with error conditions and if any are found # Add the error page. pmgr = wx.GetApp().GetPluginManager() if len(pmgr.GetIncompatible()): self._nb.AddPage(ConfigPanel(self._nb, style=wx.NO_BORDER, mode=MODE_ERROR), _("Errors"), img_id=IMG_ERROR) # Layout sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self._nb, 1, wx.EXPAND) self.SetSizer(sizer) self.SetStatusBar(eclib.ProgressStatusBar(self, style=wx.SB_FLAT)) self.SetInitialSize(size) # Event Handlers self.Bind(eclib.EVT_SB_PAGE_CHANGING, self.OnPageChanging) self.Bind(wx.EVT_CLOSE, self.OnClose) self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy, self) # Message Handlers ed_msg.Subscribe(self.OnThemeChange, ed_msg.EDMSG_THEME_CHANGED)
def __init__(self, parent): """Initialize the window""" super(VariablesShelfWindow, self).__init__(parent) config = Profile_Get(ToolConfig.PYTOOL_CONFIG, default=dict()) localsfilterexpr = config.get(ToolConfig.TLC_LOCALS_FILTEREXPR, "") globalsfilterexpr = config.get(ToolConfig.TLC_GLOBALS_FILTEREXPR, "") exceptionsfilterexpr = config.get(ToolConfig.TLC_EXCEPTIONS_FILTEREXPR, "") localsfilterlevel = config.get(ToolConfig.TLC_LOCALS_FILTERLEVEL, 0) globalsfilterlevel = config.get(ToolConfig.TLC_GLOBALS_FILTERLEVEL, 0) exceptionsfilterlevel = config.get( ToolConfig.TLC_EXCEPTIONS_FILTERLEVEL, 0) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LEFT self._nb = eclib.SegmentBook(self, style=bstyle) self._locals = VariablesList(self._nb, self.LOCALSSTR, localsfilterexpr, localsfilterlevel) self._globals = VariablesList(self._nb, self.GLOBALSSTR, globalsfilterexpr, globalsfilterlevel) self._exceptions = VariablesList(self._nb, self.EXCEPTIONSSTR, exceptionsfilterexpr, exceptionsfilterlevel) # Setup self._InitImageList() self._nb.AddPage(self._locals, _("Locals"), img_id=0) self._nb.AddPage(self._globals, _("Globals"), img_id=1) self._nb.AddPage(self._exceptions, _("Exceptions"), img_id=2) # NOTE: page order must be kept in sync with this map self.pmap = { 0: (ToolConfig.TLC_LOCALS_FILTEREXPR, ToolConfig.TLC_LOCALS_FILTERLEVEL, self._locals), 1: (ToolConfig.TLC_GLOBALS_FILTEREXPR, ToolConfig.TLC_GLOBALS_FILTERLEVEL, self._globals), 2: (ToolConfig.TLC_EXCEPTIONS_FILTEREXPR, ToolConfig.TLC_EXCEPTIONS_FILTERLEVEL, self._exceptions) } ctrlbar = self.setup(self._nb, self._locals, self._globals, self._exceptions) self.refreshbtn = self.AddPlateButton(u"", ed_glob.ID_REFRESH, wx.ALIGN_LEFT) self.refreshbtn.ToolTip = wx.ToolTip(_("Refresh Variables")) ctrlbar.AddStretchSpacer() self.filterlevel = wx.Choice(ctrlbar, wx.ID_ANY, choices=(_("Off"), _("Medium"), _("Maximum"))) self.filterlevel.SetSelection(localsfilterlevel) text = wx.StaticText(ctrlbar, label=_("Filtering:")) ctrlbar.AddControl(text, wx.ALIGN_RIGHT) self.search = eclib.CommandEntryBase(ctrlbar, style=wx.TE_PROCESS_ENTER) self.search.Enable(True) self.search.SetDescriptiveText(u"Enter Regular Expression") if localsfilterexpr: self.search.SetValue(localsfilterexpr) self.search.ShowSearchButton(True) self.search.ShowCancelButton(True) ctrlbar.AddControl(self.search, wx.ALIGN_RIGHT, 2) ctrlbar.AddControl(self.filterlevel, wx.ALIGN_RIGHT) if RpdbDebugger().analyzing: self.layout(self.STOPANALYZELBL, self.OnAnalyze) else: self.layout(self.ANALYZELBL, self.OnAnalyze) self.taskbtn.SetBitmap(Images.Inspect.Bitmap) # Debugger attributes RpdbDebugger().clearlocalvariables = self._locals.Clear RpdbDebugger().updatelocalvariables = self._locals.update_namespace RpdbDebugger().clearglobalvariables = self._globals.Clear RpdbDebugger().updateglobalvariables = self._globals.update_namespace RpdbDebugger().clearexceptions = self._exceptions.Clear RpdbDebugger().updateexceptions = self._exceptions.update_namespace RpdbDebugger().updateanalyze = self.UpdateAnalyze # Event Handlers self.Bind(eclib.EVT_SB_PAGE_CHANGED, self.OnPageChanged, self._nb) self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.refreshbtn) self.Bind(wx.EVT_CHOICE, self.OnSetFilterLevel, self.filterlevel) self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnRefresh, self.search) self.Bind(wx.EVT_TEXT_ENTER, self.OnRefresh, self.search) self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancelSearch, self.search) RpdbDebugger().update_namespace()