³ò žl‡Jc @s¾dZdZddkZddkZddkTddklZlZddkl Z ha dddd „Z dddd „Z d d ddddd „Z d „Zddd„Zd„ZdS(sWdistutils.dir_util Utility functions for manipulating directories and directory trees.s5$Id: dir_util.py 39416 2005-08-26 15:20:46Z tim_one $iÿÿÿÿN(t*(tDistutilsFileErrortDistutilsInternalError(tlogiÿic CsÀt|tƒptd|f‚ntii|ƒ}g}tii|ƒp |djo|Sntitii |ƒƒo|Sntii |ƒ\}}|g}xO|oG|o@tii|ƒ o,tii |ƒ\}}|i d|ƒq¬Wx¾|D]¶}tii ||ƒ}tii |ƒ} ti| ƒoqnt id|ƒ|pQyti|ƒ|i|ƒWq®tj o } td|| df‚q®Xndt| %sR(tdistutils.file_utilR+RRR RtlistdirterrorR RtislinktreadlinkRRtsymlinkRtextendt copy_tree(tsrctdstt preserve_modetpreserve_timestpreserve_symlinkstupdateRRR+tnamesterrnoterrstrtoutputstntsrc_nametdst_namet link_dest((s%/sys/lib/python/distutils/dir_util.pyR3psB    cCs—xzti|ƒD]i}tii||ƒ}tii|ƒo%tii|ƒ ot||ƒq|iti|fƒqW|iti |fƒdS(N( RR-RRR R/t_build_cmdtupleRtremovetrmdir(Rt cmdtuplestftreal_f((s%/sys/lib/python/distutils/dir_util.pyRB·s'c CsÜddkl}tid|ƒ|odSng}t||ƒx“|D]‹}yMt|d|dfƒtii|dƒ}t i |ƒo t |=nWqIt t fj o#}ti ||d|ƒƒqIXqIWdS(s‰Recursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true). iÿÿÿÿ(tgrok_environment_errors'removing '%s' (and everything under it)Niiserror removing %s: (tdistutils.utilRHRRRBtapplyRRR R thas_keytIOErrorRtwarn(t directoryRRRHREtcmdR R((s%/sys/lib/python/distutils/dir_util.pyt remove_treeÁs   cCshtii|ƒ\}}tidjoti|Sn.|dd!tijo||d}n|SdS(ssTake the full path 'path', and make it a relative path so it can be the second argument to os.path.join(). tmaciiN(RRt splitdrivetsystplatformtsep(Rtdrive((s%/sys/lib/python/distutils/dir_util.pytensure_relativeÙs (t__doc__t __revision__RRSttypestdistutils.errorsRRt distutilsRR R R*R3RBRPRW(((s%/sys/lib/python/distutils/dir_util.pyss" C A