##// END OF EJS Templates
Fix yet another resolve corner case...
Fix yet another resolve corner case -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fix yet another resolve corner case manifest hash: a194321b5cd718a3c31f327c5145a4ebd8dd4ef4 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCr+IvywK+sNU5EO8RAt49AJwLBBq7AZfo1WqcwZvzSVENvJGLmgCePumQ 0/9RwjL/PorsvFJi+CiFYyY= =S6HA -----END PGP SIGNATURE-----

File last commit:

r262:3db70014 default
r344:db419f14 default
Show More
demandload.py
15 lines | 384 B | text/x-python | PythonLexer
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