def cursorAtSpaceEnd(block):
            cursor = QTextCursor(block)
            cursor.setPosition(block.position() + len(blockIndentation(block)))
            return cursor
def close(self):
        time.sleep(0.1)
        self.sock.close()
        return 0