Example #1
0
    def run(self):
        currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
        if not self.env['commandBuffer']['bookMarks'][self.ID]:
            self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
            return
        if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
            self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
            return
        if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
            self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
            return

        # set marks
        marked = ''
        startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
        if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
            endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
            marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
        else:
            x, y, marked = \
              line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
        if marked.isspace():
            self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
        else:
            self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
    def run(self):
        if not self.env['commandBuffer']['Marks']['1']:
            self.env['runtime']['outputManager'].presentText(
                _("one or two marks needed"), interrupt=True)
            return
        if not self.env['commandBuffer']['Marks']['2']:
            self.env['runtime']['cursorManager'].setMark()

        # use the last first and the last setted mark as range
        startMark = self.env['commandBuffer']['Marks']['1'].copy()
        endMark = self.env['commandBuffer']['Marks']['2'].copy()

        marked = mark_utils.getTextBetweenMarks(
            startMark, endMark, self.env['screenData']['newContentText'])

        self.env['commandBuffer']['clipboard'] = [
            marked
        ] + self.env['commandBuffer'][
            'clipboard'][:self.env['runtime']['settingsManager'].
                         getSettingAsInt('general', 'numberOfClipboards') - 1]
        self.env['commandBuffer']['currClipboard'] = 0
        # reset marks
        self.env['runtime']['cursorManager'].clearMarks()

        self.env['runtime']['outputManager'].presentText(
            marked, soundIcon='CopyToClipboard', interrupt=True)
Example #3
0
    def run(self):
        if not (self.env['commandBuffer']['Marks']['1'] and \
          self.env['commandBuffer']['Marks']['2']):
            self.env['runtime']['outputManager'].presentText(
                _("please set begin and endmark"), interrupt=True)
            return

        # use the last first and the last setted mark as range
        startMark = self.env['commandBuffer']['Marks']['1'].copy()
        endMark = self.env['commandBuffer']['Marks']['2'].copy()

        marked = mark_utils.getTextBetweenMarks(
            startMark, endMark, self.env['screenData']['newContentText'])

        if marked.isspace():
            self.env['runtime']['outputManager'].presentText(
                _("blank"), soundIcon='EmptyLine', interrupt=True)
        else:
            self.env['runtime']['outputManager'].presentText(marked,
                                                             interrupt=True)