MCPcopy Create free account
hub / github.com/ActiveState/code / _export

Function _export

recipes/Python/510396_KRMKv3__optpy/recipe-510396.py:48–66  ·  view source on GitHub ↗

Export all subkeys in key to globals.

(key, ignore)

Source from the content-addressed store, hash-verified

46 raise NotImplementedError, 'Cannot solve for %s' % type(value)
47
48def _export(key, ignore):
49 'Export all subkeys in key to globals.'
50 try:
51 GLOBAL = globals()
52 root = _wi.Key(_wi.HKEY.CURRENT_USER, key)
53 for key in root.keys:
54 GLOBAL[key] = obj = _Virtual(_wi.Key(root, key, _wi.KEY.ALL_ACCESS))
55 attr = getattr(_in, key)
56 delattr(_in, key)
57 if key not in ignore:
58 for key in obj:
59 assert type(obj[key]) == type(attr[key])
60 del attr[key]
61 assert not attr
62 assert not sum(map(lambda name: name.isupper(), dir(_in)))
63 except:
64 _TK.Tk().withdraw()
65 _MB.showerror('Error', 'Please install this program first.')
66 raise SystemExit, 1
67
68################################################################################
69

Callers 1

recipe-510396.pyFile · 0.85

Calls 4

mapFunction · 0.85
dirFunction · 0.85
_VirtualClass · 0.70
sumFunction · 0.50

Tested by

no test coverage detected