def __init__(self, parent, token): # Find our containing snippet for visual_content snippet = parent while snippet: try: self._text = snippet.visual_content.text self._mode = snippet.visual_content.mode break except AttributeError: snippet = snippet._parent if not self._text: self._text = token.alternative_text self._mode = "v" NoneditableTextObject.__init__(self, parent, token) TextObjectTransformation.__init__(self, token)