def cursorAtSpaceEnd(block):
            cursor = QTextCursor(block)
            cursor.setPosition(block.position() + len(blockIndentation(block)))
            return cursor
def flush(self):
        if self._bufferedCommands is None:
            return
        self._connection.sendline(str(self._bufferedCommands))
        self._bufferedCommands = None