def _test_speed(self):
        buf = RichTextBuffer()
        io = RichTextIO()

        t = time.time()
        io.load(None, buf,
                "test/data/notebook-v4/stress tests/"
                "A huge page of formatted text/page.html")
        print time.time() - t
    def _test_speed(self):
        buf = RichTextBuffer()
        io = RichTextIO()

        t = time.time()
        io.load(None, buf,
                "test/data/notebook-v4/stress tests/"
                "A huge page of formatted text/page.html")
        print(time.time() - t)
Beispiel #3
0
    def __init__(self, app):
        KeepNoteEditor.__init__(self, app)
        self._app = app
        self._notebook = None

        # state
        self._page = None  # current NoteBookPage
        self._page_scrolls = {}  # remember scroll in each page
        self._page_cursors = {}
        self._textview_io = RichTextIO()

        # textview and its callbacks
        self._textview = RichTextView(
            RichTextBuffer(self._app.get_richtext_tag_table()))  # textview
        self._textview.disable()
        self._textview.connect("modified", self._on_modified_callback)
        self._textview.connect("visit-url", self._on_visit_url)

        # scrollbars
        self._sw = gtk.ScrolledWindow()
        self._sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self._sw.set_shadow_type(gtk.SHADOW_IN)
        self._sw.add(self._textview)
        self.pack_start(self._sw)

        #self._socket = gtk.Socket()
        #self.pack_start(self._socket)

        # menus
        self.editor_menus = EditorMenus(self._app, self)

        # find dialog
        self.find_dialog = dialog_find.KeepNoteFindDialog(self)

        self.show_all()
Beispiel #4
0
    def __init__(self, app):
        KeepNoteEditor.__init__(self, app)
        self._app = app
        self._notebook = None

        self._link_picker = None
        self._maxlinks = 10  # maximum number of links to show in link picker

        # state
        self._page = None  # current NoteBookPage
        self._page_scrolls = {}  # remember scroll in each page
        self._page_cursors = {}
        self._textview_io = RichTextIO()

        # textview and its callbacks
        if SourceView:
            self._textview = SourceView(SourceBuffer())
            self._textview.get_buffer().set_highlight_syntax(True)
            #self._textview.set_show_margin(True)
            #self._textview.disable()
        else:
            self._textview = RichTextView(
                RichTextBuffer(self._app.get_richtext_tag_table()))  # textview
            self._textview.disable()
            self._textview.connect("modified", self._on_modified_callback)
            self._textview.connect("visit-url", self._on_visit_url)

        # scrollbars
        self._sw = gtk.ScrolledWindow()
        self._sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self._sw.set_shadow_type(gtk.SHADOW_IN)
        self._sw.add(self._textview)
        self.pack_start(self._sw)

        #self._socket = gtk.Socket()
        #self.pack_start(self._socket)

        # menus
        #self.editor_menus = EditorMenus(self._app, self)

        # find dialog
        #self.find_dialog = dialog_find.KeepNoteFindDialog(self)

        self.show_all()