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'')
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_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')
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 _findLink (self): """ Попытаться найти ссылку или в выделенном тексте, или в буфере обмена """ if self._isLink (self.selectedString): return self.selectedString clipboardText = getClipboardText() if clipboardText != None and self._isLink (clipboardText): return clipboardText return u""
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''
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'')
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')
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, '')