Ńň §ÚęLc@szdZddklZddklZlZlZlZddkl Z l Z l Z d„Z dei fd„ƒYZd S( sŢFixer for import statements. If spam is being imported from the local directory, this import: from spam import eggs Becomes: from .spam import eggs And this import: import spam Becomes: from . import spam i(t fixer_basei˙˙˙˙(tdirnametjointexiststsep(t FromImporttsymsttokenccsř|g}xč|oŕ|iƒ}|itijo |iVq |itijo3dig}|iD]}||iqe~ƒVq |iti jo|i |idƒq |iti jo!|i |iddd…ƒq t dƒ‚q WdS(sF Walks over all the names imported in a dotted_as_names node. tiNiţ˙˙˙sunkown node type(tpopttypeRtNAMEtvalueRt dotted_nameRtchildrentdotted_as_nametappendtdotted_as_namestextendtAssertionError(tnamestpendingtnodet_[1]tch((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyttraverse_importss   3!t FixImportcBs)eZdZd„Zd„Zd„ZRS(sj import_from< 'from' imp=any 'import' ['('] any [')'] > | import_name< 'import' imp=any > cCs/tt|ƒi||ƒd|ij|_dS(Ntabsolute_import(tsuperRt start_treetfuture_featurestskip(tselfttreetname((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyR.scCs|iodS|d}|itijoZx"t|dƒp|id}q/W|i|iƒod|i|_|iƒqnt }t }x4t |ƒD]&}|i|ƒo t }qŸt }qŸW|o |o|i |dƒndSt d|gƒ}|i|_|SdS(NtimpR iu.s#absolute and local imports together(RR Rt import_fromthasattrRtprobably_a_local_importR tchangedtFalseRtTruetwarningRtprefix(R RtresultsR#t have_localt have_absolutetmod_nametnew((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyt transform2s0      cCs§|idƒotS|iddƒd}t|iƒ}t||ƒ}ttt|ƒdƒƒptSx6dtdddd gD]}t||ƒotSqƒWtS( Nu.iis __init__.pys.pys.pycs.sos.sls.pyd( t startswithR(tsplitRtfilenameRRRR)(R timp_namet base_pathtext((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyR&Ts (t__name__t __module__tPATTERNRR1R&(((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyR&s  "N(t__doc__RRtos.pathRRRRt fixer_utilRRRRtBaseFixR(((s0/usr/lib64/python2.6/lib2to3/fixes/fix_import.pyt s "