def cursorAtSpaceEnd(block):
            cursor = QTextCursor(block)
            cursor.setPosition(block.position() + len(blockIndentation(block)))
            return cursor
def chunkstring(s, n):
    return [ s[i:i+n] for i in xrange(0, len(s), n) ]