Mercurial > hg > mercurial-crew-with-dirclash
view mercurial/demandload.py @ 368:4b1cec05f3eb
Add a TODO list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Add a TODO list
manifest hash: 6d50020153a16e9f746e65c177b15e44a6110ddc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCsNdNywK+sNU5EO8RAnCMAJ9Km7f0Dx8cccH44R20qqHCuBobpwCeIfuh
bBtBTknenXsF4bEo3Z6BOt4=
=b/zU
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Wed, 15 Jun 2005 17:35:09 -0800 |
parents | 3db700146536 |
children | f3abe0bdccdd |
line wrap: on
line source
def demandload(scope, modules): class d: def __getattr__(self, name): mod = self.__dict__["mod"] scope = self.__dict__["scope"] scope[mod] = __import__(mod, scope, scope, []) return getattr(scope[mod], name) for m in modules.split(): dl = d() dl.mod = m dl.scope = scope scope[m] = dl