class_docstr: A semi-functional non-gui replacement for tkinter.Text text editors.
  
      The mock's data model is that a text is a list of 
  -terminated lines.
      The mock adds an empty string at  the beginning of the list so that the
      index of actual lines start at 1, as with Tk. The methods never see this.
      Tk initializes files with a terminal 
   that cannot be deleted. It is
      invisible in the sense that one cannot move the cursor beyond it.
  
      This class is only tested (and valid) with strings of ascii chars.
      For testing, we are not concerned with Tk Text's treatment of,
      for instance, 0-width characters or character + accent.
     
class_docstr_tok: ["A","semi-functional","non-gui","replacement","for","tkinter.Text","text","editors",".","The","mock","'s","data","model","is","that","a","text","is","a","list","of","-terminated","lines",".","The","mock","adds","an","empty","string","at","the","beginning","of","the","list","so","that","the","index","of","actual","lines","start","at","1",",","as","with","Tk",".","The","methods","never","see","this",".","Tk","initializes","files","with","a","terminal","that","can","not","be","deleted",".","It","is","invisible","in","the","sense","that","one","can","not","move","the","cursor","beyond","it",".","This","class","is","only","tested","(","and","valid",")","with","strings","of","ascii","chars",".","For","testing",",","we","are","not","concerned","with","Tk","Text","'s","treatment","of",",","for","instance",",","0-width","characters","or","character","+","accent","."]
docstr: Return slice from index1 to index2 (default is 'index1+1').
docstr_tok: ["Return","slice","from","index1","to","index2","(","default","is","'index1+1","'",")","."]
code: def get(self, index1, index2=None):
      "Return slice from index1 to index2 (default is 'index1+1')."
  
      startline, startchar = self._decode(index1)
      if index2 is None:
          endline, endchar = startline, startchar + 1
      else:
          endline, endchar = self._decode(index2)
  
      if startline == endline:
          return self.data[startline][startchar:endchar]
      else:
          lines = [self.data[startline][startchar:]]
          for i in range(startline + 1, endline):
              lines.append(self.data[i])
          lines.append(self.data[endline][:endchar])
          return "".join(lines)
  
imports: import re
  from _tkinter import TclError
label_desc: Use image node_id 6 for calling the Text obj's underlying member method code with example usage: obj.get(index1, index2) and returns: self, str