def __init__(self, streams_to_watch={}, *args, **kwargs): GladeAppWindow.__init__(self, gladeFile()) ## Forward injected to imported Plide modules PlideHelp.define_injected(injected) PlideTab.define_injected(injected) PyPLearnOptionsDialog.define_injected(injected, gladeFile) ## Initialize Members self.untitled_counter = 1 self.work_requests = {} # Request ids to expdir mapping self.all_plearn_classes = injected.getAllClassnames() ## Initialize Display self.setup_statusbar() self.log_filters = [ re.compile("WARNING.*Scintilla.*PosChanged.*deprecated") ] self.log_clear() self.log_hide() welcome_text = kwargs.get( "welcome_text", "<b>Welcome to Plide %s!</b>" % self.PlideVersion) self.status_display(welcome_text, has_markup=True) self.setup_stdouterr_redirect(streams_to_watch) ## Set up help system injected.helpResourcesPath(helpResourcesPath()) self.help_viewer = PlideHelp(self) self.help_viewer.display_page("index.html") self.help_close() ## Prepare the work queue self.work_queue = PLearnWorkQueue()
def __init__(self, streams_to_watch={}, *args, **kwargs): GladeAppWindow.__init__(self, gladeFile()) ## Forward injected to imported Plide modules PlideHelp.define_injected(injected) PlideTab.define_injected(injected) PyPLearnOptionsDialog.define_injected(injected, gladeFile) ## Initialize Members self.untitled_counter = 1 self.work_requests = {} # Request ids to expdir mapping self.all_plearn_classes = injected.getAllClassnames() ## Initialize Display self.setup_statusbar() self.log_filters = [re.compile("WARNING.*Scintilla.*PosChanged.*deprecated")] self.log_clear() self.log_hide() welcome_text = kwargs.get("welcome_text", "<b>Welcome to Plide %s!</b>" % self.PlideVersion) self.status_display(welcome_text, has_markup=True) self.setup_stdouterr_redirect(streams_to_watch) ## Set up help system injected.helpResourcesPath(helpResourcesPath()) self.help_viewer = PlideHelp(self) self.help_viewer.display_page("index.html") self.help_close() ## Prepare the work queue self.work_queue = PLearnWorkQueue()
def quit(self): ## Minor hack: the main-thread loop is terminated by receiving a ## 'script' whose contents is Quit(). First close all tabs and ## ensure that we stop the process if some tabs won't be closed. n = self.w_plide_notebook.get_n_pages() for i in range(n - 1, -1, -1): tab = self.get_nth_tab(i) if not tab.close_tab(): return True # Stop close process if cannot close tab print >> raw_stderr, "Quit message received" raw_stderr.flush() self.work_queue.post_work_request("Quit()", "", "") GladeAppWindow.quit(self)