parameters: (self, text, first)
docstring: Precondition: The object with the unique identifier “textFrame”
          (constructor argument) currently exists in the current document,
          and it refers to a text frame. “first” is a non-negative
          integer ≤ length(). “text” is of type “unicode”.
          Postcondition: The text is inserted at the given index position.
  
          Note that the indexes are the indexes provided by
          scribus. This may not be unicode characters, but UTF16 code units,
          and if you choose half a surrogate pair, scribus will insert between
          them, making the unicode text string invalid.
          0The indexes does not refer to the actual
          text content of “textFrame”, but to the content of the underlying
          “story”, that means the common text content that is shared between
          this text frame and all linked text frames. Note that this function
          will (likely) change the current text selection of the story.
docstring_summary: Precondition: The object with the unique identifier “textFrame”
          (constructor argument) currently exists in the current document,
          and it refers to a text frame. “first” is a non-negative
          integer ≤ length(). “text” is of type “unicode”.
          Postcondition: The text is inserted at the given index position.
docstring_tokens: Precondition : The object with the unique identifier “textFrame” ( constructor argument ) currently exists in the current document and it refers to a text frame . “first” is a non - negative integer ≤ length () . “text” is of type “unicode” . Postcondition : The text is inserted at the given index position .
function: def insert_text(self, text, first):
          """Precondition: The object with the unique identifier “textFrame”
          (constructor argument) currently exists in the current document,
          and it refers to a text frame. “first” is a non-negative
          integer ≤ length(). “text” is of type “unicode”.
          Postcondition: The text is inserted at the given index position.
  
          Note that the indexes are the indexes provided by
          scribus. This may not be unicode characters, but UTF16 code units,
          and if you choose half a surrogate pair, scribus will insert between
          them, making the unicode text string invalid.
          0The indexes does not refer to the actual
          text content of “textFrame”, but to the content of the underlying
          “story”, that means the common text content that is shared between
          this text frame and all linked text frames. Note that this function
          will (likely) change the current text selection of the story."""
          if (type(first) is not int) or (type(text) is not unicode):
              raise TypeError("“first” must be “integer” and “text” must "
                              "be “unicode”, but they aren’t.")
          if first < 0:
              # We have to check for “first < 0” here, because scribus
              # would accept “first == -1” as valid, but we do not
              # want this behaviour here.
              raise IndexError("“first” must"
                               "not be negative, but it is.")
          if scribus.getObjectType(self.__identifier) != "TextFrame":
              raise RuntimeError("The argument “textFrame” that was given in "
                                 "the constructor does currently not refer to "
                                 "a text frame in the current document.")
          scribus.insertText(
              text.encode("utf8", "strict"),
              first,
              self.__identifier)
function_tokens: def insert_text ( self , text , first ) : if ( type ( first ) is not int ) or ( type ( text ) is not unicode ) : raise TypeError ( "“first” must be “integer” and “text” must " "be “unicode”, but they aren’t.") if first < 0 : # We have to check for “first < 0” here, because scribus # would accept “first == -1” as valid, but we do not # want this behaviour here. raise IndexError ( "“first” must" "not be negative, but it is." ) if scribus . getObjectType ( self . __identifier ) != "TextFrame" : raise RuntimeError ( "The argument “textFrame” that was given in " "the constructor does currently not refer to " "a text frame in the current document." ) scribus . insertText ( text . encode ( "utf8" , "strict" ) , first , self . __identifier )