def _export(key, ignore):
    'Export all subkeys in key to globals.'
    try:
        GLOBAL = globals()
        root = _wi.Key(_wi.HKEY.CURRENT_USER, key)
        for key in root.keys:
            GLOBAL[key] = obj = _Virtual(_wi.Key(root, key, _wi.KEY.ALL_ACCESS))
            attr = getattr(_in, key)
            delattr(_in, key)
            if key not in ignore:
                for key in obj:
                    assert type(obj[key]) == type(attr[key])
                    del attr[key]
                assert not attr
        assert not sum(map(lambda name: name.isupper(), dir(_in)))
    except:
        _TK.Tk().withdraw()
        _MB.showerror('Error', 'Please install this program first.')
        raise SystemExit, 1
Export all subkeys in key to globals.
recipes/Python/510396_KRMKv3__optpy/recipe-510396.py