mò óRÅDc@s[dZdZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zd S( s1Demand load modules when used, not when imported.s»Copyright 2006 Vadim Gelfer . This software may be used and distributed according to the terms of the GNU General Public License, incorporated herein by reference.t _importercBs tZdZd„Zd„ZRS(s^import a module. it is not imported until needed, and is imported at most once per scope.cCs(||_||_||_d|_dS(sÇscope is context (globals() or locals()) in which import should be made. modname is name of module to import. fromlist is list of modules for "from foo import ..." emulation.N(tscopetselftmodnametfromlisttNonetmod(RRRR((t8/usr/lib/python2.4/site-packages/mercurial/demandload.pyt__init__s    cCsK|idjo4t|i|i|i|iƒ|_|`|`n|iS(s(import the module if needed, and return.N(RRRt __import__RRR(R((Rtmodules (t__name__t __module__t__doc__RR (((RR s  t _replacercBs)tZdZd„Zd„Zd„ZRS(s7placeholder for a demand loaded module. demandload puts this in a target scope. when an attribute of this object is looked up, this object is replaced in the target scope with the actual module. we use __getattribute__ to avoid namespace clashes between placeholder object and real module.cCs||_||_g|_dS(N(timporterRttargettlater(RRR((RR+s  cCsti|dƒiƒS(NR(tobjectt__getattribute__RR (R((RR 5scCs‰ti|dƒƒ}ti|dƒ}ti|dƒ}ti|dƒ}|ot|idi |ƒƒn||i |