def views_dict()

in chef/cookbooks/cpe_umad/files/resources/nibbler.py [0:0]


def views_dict(nib_obj):
    # Find the NSWindow instance at the top level
    all_windows = [x for x in nib_obj if x.className() == 'NSWindow']
    win = all_windows[0]
    # Now find all the views within the window where the identifier is defined
    top_view = win.contentView()
    v_dict = dict()
    for v in views_recursive(top_view):
        ident = v.identifier()
        if ident is not None:
            if not ident.startswith('_'):
                # Someone has customized it, remember it
                v_dict[ident] = v
    return v_dict