def close(self): PythonShellMixin.close(self, sys.stderr.write) # take care of the frame if self._frame: self._frame.Destroy() del self._frame
def __init__(self, module_manager): ModuleBase.__init__(self, module_manager) self.inputs = [None] * NUMBER_OF_INPUTS self.outputs = [None] * NUMBER_OF_OUTPUTS self._config.scratch_src = self._config.setup_src = \ self._config.execute_src = '' self._config_srcs = ['scratch_src', 'setup_src', 'execute_src'] # these are the real deals, i.e. the underlying logic self._src_scratch = self._src_setup = self._src_execute = '' self._srcs = ['_src_scratch', '_src_setup', '_src_execute'] # we use this to determine whether the current setup src has been # executed or not self._md5_setup_src = '' self._create_view_frame() PythonShellMixin.__init__(self, self._view_frame.shell_window, module_manager) module_utils.create_eoca_buttons(self, self._view_frame, self._view_frame.view_frame_panel, ok_default=False, cancel_hotkey=False) # more convenience bindings self._editwindows = [self._view_frame.scratch_editwindow, self._view_frame.setup_editwindow, self._view_frame.execute_editwindow] self.interp = self._view_frame.shell_window.interp # set interpreter on all three our editwindows for ew in self._editwindows: ew.set_interp(self.interp) self._bind_events() self.interp.locals.update( {'obj' : self}) # initialise macro packages self.support_vtk(self.interp) self.support_matplotlib(self.interp) self.config_to_logic() self.logic_to_config() self.config_to_view() self.view_initialised = True self.view()
def __init__(self, module_manager): ModuleBase.__init__(self, module_manager) self.inputs = [None] * NUMBER_OF_INPUTS self.outputs = [None] * NUMBER_OF_OUTPUTS self._config.scratch_src = self._config.setup_src = \ self._config.execute_src = '' self._config_srcs = ['scratch_src', 'setup_src', 'execute_src'] # these are the real deals, i.e. the underlying logic self._src_scratch = self._src_setup = self._src_execute = '' self._srcs = ['_src_scratch', '_src_setup', '_src_execute'] # we use this to determine whether the current setup src has been # executed or not self._md5_setup_src = '' self._create_view_frame() PythonShellMixin.__init__(self, self._view_frame.shell_window, module_manager) module_utils.create_eoca_buttons(self, self._view_frame, self._view_frame.view_frame_panel, ok_default=False, cancel_hotkey=False) # more convenience bindings self._editwindows = [ self._view_frame.scratch_editwindow, self._view_frame.setup_editwindow, self._view_frame.execute_editwindow ] self.interp = self._view_frame.shell_window.interp # set interpreter on all three our editwindows for ew in self._editwindows: ew.set_interp(self.interp) self._bind_events() self.interp.locals.update({'obj': self}) # initialise macro packages self.support_vtk(self.interp) self.support_matplotlib(self.interp) self.config_to_logic() self.logic_to_config() self.config_to_view() self.view_initialised = True self.view()
def close(self): # parameter is exception_printer method PythonShellMixin.close(self, self._module_manager.log_error_with_exception) for i in range(len(self.get_input_descriptions())): self.set_input(i, None) self._view_frame.Destroy() del self._view_frame ModuleBase.close(self)
def __init__(self, parent_window, title, icon, devide_app): self._devide_app = devide_app self._parent_window = parent_window self._frame = self._create_frame() # set icon self._frame.SetIcon(icon) # and change the title self._frame.SetTitle(title) # call ctor of mixin PythonShellMixin.__init__(self, self._frame.shell_window, self._devide_app.get_module_manager()) self._interp = self._frame.shell_window.interp # setup structure we'll use for working with the tabs / edits self._tabs = Tabs(self._frame.edit_notebook, self._frame) self._tabs.add_existing(self._frame.default_editwindow, self._interp) self._bind_events() # make sure that when the window is closed, we just hide it (teehee) wx.EVT_CLOSE(self._frame, self.close_ps_frame_cb) #wx.EVT_BUTTON(self._psFrame, self._psFrame.closeButton.GetId(), # self.close_ps_frame_cb) # we always start in this directory with our fileopen dialog #self._snippetsDir = os.path.join(appDir, 'snippets') #wx.EVT_BUTTON(self._psFrame, self._psFrame.loadSnippetButton.GetId(), # self._handlerLoadSnippet) self.support_vtk(self._interp) self.support_matplotlib(self._interp) # we can display ourselves self.show()