def __init__(self, notebook, pmat_filename): PlideTab.__init__(self, notebook) pmat = PMatListModel(PMat(pmat_filename, openmode='r')) viewer = MatrixViewer(pmat).get_widget() title = os.path.basename(pmat_filename) viewer.show_all() self.append_to_notebook(viewer, title, self.TAB_TYPE_DOCUMENT)
def __init__(self, notebook, pmat_filename ): PlideTab.__init__(self, notebook) pmat = PMatListModel(PMat(pmat_filename, openmode='r')) viewer = MatrixViewer(pmat).get_widget() title = os.path.basename(pmat_filename) viewer.show_all() self.append_to_notebook(viewer,title,self.TAB_TYPE_DOCUMENT)
def double_click_callback(self, browser, pathname, isdir): if not isdir: ext = os.path.splitext(pathname)[1] viewer = None if ext == ".pmat": pmat = PMatListModel(PMat(pathname, openmode='r')) viewer = MatrixViewer(pmat).get_widget() else: f = open(pathname) contents = f.read() f.close() viewer = PlideTabScintilla.scintilla_widget(contents, True) if ext in [".py", ".pymat", ".pyplearn", ".plearn", ".psave"]: PlideTabPython.set_scintilla_style_for_python(viewer) if viewer: container_remove_children(self.w_frame_right) viewer.show_all() self.w_frame_right.add(viewer)
def double_click_callback( self, browser, pathname, isdir ): if not isdir: ext = os.path.splitext(pathname)[1] viewer = None if ext == ".pmat": pmat = PMatListModel(PMat(pathname, openmode='r')) viewer = MatrixViewer(pmat).get_widget() else: f = open(pathname) contents = f.read() f.close() viewer = PlideTabScintilla.scintilla_widget(contents, True) if ext in [ ".py", ".pymat", ".pyplearn", ".plearn", ".psave" ]: PlideTabPython.set_scintilla_style_for_python(viewer) if viewer: container_remove_children(self.w_frame_right) viewer.show_all() self.w_frame_right.add(viewer)