@property
    def wm_window_role(self):
        if not self.window_role:
            out = getoutput('xprop -id %s WM_WINDOW_ROLE' % self.id)
            try:
                _, value = out.split(' = ')
            except __HOLE__:
                # probably xprop returned an error
                return ''
            else:
                self.window_role = value.strip('"')
        return self.window_role
dataset/ETHPy150Open generalov/look-at/look_at/wmctrl.py/Window.wm_window_role