'Return text in range buf[start:end]
Note: Start position is inclusive, end position is exclusive.'

def text_range(self, start, end):

    if ((start >= self._cacheFirstBufPos) and (end <= self._cacheLastBufPos)):
        cstart = (start - self._cacheFirstBufPos)
        cend = (end - self._cacheFirstBufPos)
        if self._debug:
            print ('text_range::    cstart:    %d,    cend:    %d' % (cstart, cend))
            print ('text_range::    start:    %d,    end    %d' % (start, end))
            print ('text_range::    _cacheFirstBufPos:    %d,    _cacheLastBufPos:    %d' % (self._cacheFirstBufPos, self._cacheLastBufPos))
        return ''.join(self._chCache[cstart:cend])
    if self._debug:
        print ('text_range::    using    parent    text_range:    %r    -    %r' % (start, end))
    return self._accessor.text_range(start, end)
