Mercurial > hg > mercurial-crew-with-dirclash
view mercurial/demandload.py @ 281:574420507d8c
hg cat: relative file support
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hg cat: relative file support
also fix a bug in relpath
From: K Thananchayan <thananck@yahoo.com>
manifest hash: a443a66dfb90b38ea491de1e817b2877170bc9f8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCp0AGywK+sNU5EO8RAgfVAJ9vlXfLKs1A/TegG3wuPeuxoSQMCACbBPGF
RObiYj1st0k1zQYBlvSlQbk=
=GZbB
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Wed, 08 Jun 2005 10:59:18 -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