Esempio n. 1
0
    def test_CopyLineToClipboard_01(self):
        text = u''
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)

        actionController.getAction(CLIPBOARD_COPY_LINE).run(None)
        cb_text = getClipboardText()

        self.assertEqual(cb_text, u'')
Esempio n. 2
0
    def test_CopyWordToClipboard_06(self):
        text = u' слово слово2'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(7)

        actionController.getAction(CLIPBOARD_COPY_WORD).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        self.assertEqual(cb_text, u'слово2')
    def test_CopyWordToClipboard_06(self):
        text = u' слово слово2'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(7)

        actionController.getAction(CLIPBOARD_COPY_WORD).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        self.assertEqual(cb_text, u'слово2')
    def test_CopyLineToClipboard_01(self):
        text = u''
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)

        actionController.getAction(CLIPBOARD_COPY_LINE).run(None)
        cb_text = getClipboardText()

        self.assertEqual(cb_text, u'')
Esempio n. 5
0
    def test_CopyLineToClipboard_06(self):
        text = u'Строка 1\nСтрока 2\n'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(9)

        actionController.getAction(CLIPBOARD_COPY_LINE).run(None)
        cb_text = getClipboardText()

        self.assertEqual(cb_text.replace(u'\r\n', u'\n'), u'Строка 2\n')
Esempio n. 6
0
    def _loadState(self):
        tagslist = TagsList(self._application.wikiroot)
        self._dialog.setTagsList(tagslist)
        if (self._parentPage is not None
                and self._parentPage.parent is not None):
            self._dialog.tags = self._parentPage.tags

        clipboardText = getClipboardText()
        if clipboardText is not None and isLink(clipboardText):
            self._dialog.url = clipboardText
            self._dialog.urlText.SetSelection(0, len(clipboardText))
Esempio n. 7
0
    def _loadState(self):
        tagslist = TagsList(self._application.wikiroot)
        self._dialog.setTagsList(tagslist)
        if (self._parentPage is not None and
                self._parentPage.parent is not None):
            self._dialog.tags = self._parentPage.tags

        clipboardText = getClipboardText()
        if clipboardText is not None and isLink(clipboardText):
            self._dialog.url = clipboardText
            self._dialog.urlText.SetSelection(0, len(clipboardText))
    def test_CopyLineToClipboard_06(self):
        text = u'Строка 1\nСтрока 2\n'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(9)

        actionController.getAction(CLIPBOARD_COPY_LINE).run(None)
        cb_text = getClipboardText()

        self.assertEqual(cb_text.replace(u'\r\n', u'\n'), u'Строка 2\n')
Esempio n. 9
0
    def _findLink (self):
        """
        Попытаться найти ссылку или в выделенном тексте, или в буфере обмена
        """
        if self._isLink (self.selectedString):
            return self.selectedString

        clipboardText = getClipboardText()
        if clipboardText != None and self._isLink (clipboardText):
            return clipboardText

        return u""
Esempio n. 10
0
    def _findLink(self):
        """
        Попытаться найти ссылку или в выделенном тексте, или в буфере обмена
        """
        if self._isLink(self._selectedString):
            return self._selectedString

        clipboardText = getClipboardText()
        if clipboardText is not None and self._isLink(clipboardText):
            return clipboardText

        return u''
Esempio n. 11
0
    def test_CutWordToClipboard_04(self):
        text = u'слово'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(5)

        actionController.getAction(CLIPBOARD_CUT_WORD).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        newtext = editor.GetText().replace(u'\r\n', u'\n')

        self.assertEqual(cb_text, u'слово')
        self.assertEqual(newtext, u'')
Esempio n. 12
0
    def test_CutLineToClipboard_05(self):
        text = u'Строка 1\nСтрока 2'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(9)

        actionController.getAction(CLIPBOARD_CUT_LINE).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        newtext = editor.GetText().replace(u'\r\n', u'\n')

        self.assertEqual(cb_text, u'Строка 2')
        self.assertEqual(newtext, u'Строка 1\n')
Esempio n. 13
0
    def test_CutLineToClipboard_01(self):
        text = ''
        editor = self._getEditor()
        actionController = self.application.actionController
        editor.SetText(text)
        editor.GotoPos(0)

        actionController.getAction(CLIPBOARD_CUT_LINE).run(None)
        cb_text = getClipboardText()
        newtext = editor.GetText().replace('\r\n', '\n')

        self.assertEqual(cb_text, '')
        self.assertEqual(newtext, '')
Esempio n. 14
0
    def test_CutWordToClipboard_04(self):
        text = u'слово'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(5)

        actionController.getAction(CLIPBOARD_CUT_WORD).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        newtext = editor.GetText().replace(u'\r\n', u'\n')

        self.assertEqual(cb_text, u'слово')
        self.assertEqual(newtext, u'')
Esempio n. 15
0
    def test_CutLineToClipboard_05(self):
        text = u'Строка 1\nСтрока 2'
        editor = self._getEditor()
        actionController = Application.actionController
        editor.SetText(text)
        editor.GotoPos(9)

        actionController.getAction(CLIPBOARD_CUT_LINE).run(None)
        cb_text = getClipboardText().replace(u'\r\n', u'\n')
        newtext = editor.GetText().replace(u'\r\n', u'\n')

        self.assertEqual(cb_text, u'Строка 2')
        self.assertEqual(newtext, u'Строка 1\n')
Esempio n. 16
0
    def test_CutLineToClipboard_01(self):
        text = ''
        editor = self._getEditor()
        actionController = self.application.actionController
        editor.SetText(text)
        editor.GotoPos(0)

        actionController.getAction(CLIPBOARD_CUT_LINE).run(None)
        cb_text = getClipboardText()
        newtext = editor.GetText().replace('\r\n', '\n')

        self.assertEqual(cb_text, '')
        self.assertEqual(newtext, '')