def getSubString(self, start, end): pass n = len(self._contents) - 1 if end < 0: return "" if n < start: return "" if end < start: return "" start = archy_globals.bound(start, 0, n) end = archy_globals.bound(end, 0, n) return self._contents[start:end + 1]
def getSubString(self, start, end): pass n = len(self._contents)-1 if end < 0: return "" if n < start: return "" if end < start: return "" start = archy_globals.bound(start,0,n) end = archy_globals.bound(end,0,n) return self._contents[start:end+1]
def createNewSelection(self, startPos, endPos): lastPos = self.getLength() - 1 startPos = archy_globals.bound(startPos, 0, lastPos) endPos = archy_globals.bound(endPos, 0, lastPos) startPos, endPos = min(startPos, endPos), max(startPos, endPos) #print "in createNewSelection: selection startPos, endPos=", startPos, endPos if self.isExtendedSelection(): #print "in createNewSelection: after INSERT: ", self.selections self.selections.insert(1, [startPos, endPos]) else: self.setSelection("selection", startPos, endPos) #print "in createNewSelection: after set: ", self.selections # If this is a new extended selection, delete any old selections that overlap. if endPos - startPos + 1 > 1: self.removeOverlappingOldSelections(startPos, endPos)
def createNewSelection(self,startPos,endPos): lastPos = self.getLength()-1 startPos = archy_globals.bound(startPos, 0, lastPos) endPos = archy_globals.bound(endPos, 0, lastPos) startPos, endPos = min(startPos, endPos), max(startPos, endPos) #print "in createNewSelection: selection startPos, endPos=", startPos, endPos if self.isExtendedSelection(): #print "in createNewSelection: after INSERT: ", self.selections self.selections.insert(1,[startPos, endPos]) else: self.setSelection("selection",startPos, endPos) #print "in createNewSelection: after set: ", self.selections # If this is a new extended selection, delete any old selections that overlap. if endPos - startPos + 1 > 1: self.removeOverlappingOldSelections(startPos,endPos)