def getParent(self, selector):
        '''Get the first parent selected by the selector.

        XXX at the moment, just does name
        '''
        if isinstance(selector, str):
            if selector[0] in '.#':
                raise NotImplementedError(
                    'lookup by id and class not yet supported')
            selector = [s.strip() for s in selector.split(',')]
        if self.name in selector: return self
        return self.parent.getParent(selector)
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/element.py/Element.getParent/original