-ν
ηΆ<c       sΡ     d  Z    d k Z  d k Z 	 d k Z  d d d d d d d d	 g Z  d
 d d  Z  d   Z % d   Z , d   Z 6 d   Z	 A d   Z
 M d d  Z l d e d  Z  d   Z d S(   s   Utility functions for copying files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

Ns   copyfileobjs   copyfiles   copymodes   copystats   copys   copy2s   copytrees   rmtreei   i   c    sT      xD  d o9  |  i |  }  | o  Pn  | i |  q Wd S(   s=   copy data from file-like object fsrc to file-like object fdsti   N(   s   fsrcs   reads   lengths   bufs   fdsts   write(   s   fsrcs   fdsts   lengths   buf(    (    s   /usr/lib/python2.2/shutil.pys   copyfileobj s    
c    s      t  }  t  }  z8  t |  d  }  t | d  }  t | |  Wd    | o ! | i   n " | o # | i   n Xd S(   s   Copy data from src to dsts   rbs   wbN(   s   Nones   fsrcs   fdsts   opens   srcs   dsts   copyfileobjs   close(   s   srcs   dsts   fdsts   fsrc(    (    s   /usr/lib/python2.2/shutil.pys   copyfile s   		

c    s_   % & ' t  t d  oB ( t i |   } ) t i | t i  } * t i | |  n d S(   s   Copy mode bits from src to dsts   chmodN(
   s   hasattrs   oss   stats   srcs   sts   S_IMODEs   ST_MODEs   modes   chmods   dst(   s   srcs   dsts   modes   st(    (    s   /usr/lib/python2.2/shutil.pys   copymode% s
   c    s   , - . t  i |   } / t i | t i  } 0 t t  d  o+ 1 t  i | | t i
 | t i f  n 2 t t  d  o 3 t  i | |  n d S(   s?   Copy all stat info (mode bits, atime and mtime) from src to dsts   utimes   chmodN(   s   oss   stats   srcs   sts   S_IMODEs   ST_MODEs   modes   hasattrs   utimes   dsts   ST_ATIMEs   ST_MTIMEs   chmod(   s   srcs   dsts   modes   st(    (    s   /usr/lib/python2.2/shutil.pys   copystat, s   +c    sh   6 ; < t  i i |  o( = t  i i | t  i i |    } n > t |  |  ? t |  |  d S(   sV   Copy data and mode bits ("cp src dst").

    The destination may be a directory.

    N(	   s   oss   paths   isdirs   dsts   joins   basenames   srcs   copyfiles   copymode(   s   srcs   dst(    (    s   /usr/lib/python2.2/shutil.pys   copy6 s
   (c    sh   A F G t  i i |  o( H t  i i | t  i i |    } n I t |  |  J t |  |  d S(   s]   Copy data and all stat info ("cp -p src dst").

    The destination may be a directory.

    N(	   s   oss   paths   isdirs   dsts   joins   basenames   srcs   copyfiles   copystat(   s   srcs   dst(    (    s   /usr/lib/python2.2/shutil.pys   copy2A s
   (i    c 	   s>  M Z [ t  i |   } \ t  i |  ] x| D] ]} ^ t  i i |  |  } _ t  i i | |  } ` y a | o t  i i |  o) b t  i |  } c t  i | |  n> d t  i i |  o e t | | |  n g t | |  Wn> i t t  i f j
 o& } j d | | t |  f GHn Xq2 Wd S(   sΊ  Recursively copy a directory tree using copy2().

    The destination directory must not already exist.
    Error are reported to standard output.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied.

    XXX Consider this example code rather than the ultimate tool.

    s   Can't copy %s to %s: %sN(   s   oss   listdirs   srcs   namess   mkdirs   dsts   names   paths   joins   srcnames   dstnames   symlinkss   islinks   readlinks   linktos   symlinks   isdirs   copytrees   copy2s   IOErrors   errors   whys   str(	   s   srcs   dsts   symlinkss   linktos   dstnames   whys   srcnames   namess   name(    (    s   /usr/lib/python2.2/shutil.pys   copytreeM s    
 	c    sδ   l s t g  } u t |  |  v x» | Dv ]° } w y x t | d | d f  Wn y z t i   } { | o | n\ } | o ~ | | d | d |  n3  | d | d d | d d d | d f  n Xq) Wd S(   sΗ   Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if
    onerror is set, it is called to handle the error; otherwise, an
    exception is raised.

    i    i   s
    removing N(
   s	   cmdtupless   _build_cmdtuples   paths   cmds   applys   syss   exc_infos   excs   ignore_errorss   onerror(   s   paths   ignore_errorss   onerrors	   cmdtupless   excs   cmd(    (    s   /usr/lib/python2.2/shutil.pys   rmtreel s   	
 	

c    s―     x t  i |   D ]u }  t  i i |  |  }  t  i i |  o t  i i |  o  t | |  n  | i
 t  i | f  q W | i
 t  i |  f  d  S(   N(   s   oss   listdirs   paths   fs   joins   real_fs   isdirs   islinks   _build_cmdtuples	   cmdtupless   appends   removes   rmdir(   s   paths	   cmdtupless   real_fs   f(    (    s   /usr/lib/python2.2/shutil.pys   _build_cmdtuple s    	*(   s   __doc__s   oss   syss   stats   __all__s   copyfileobjs   copyfiles   copymodes   copystats   copys   copy2s   copytrees   Nones   rmtrees   _build_cmdtuple(   s   copyfiles   stats   copyfileobjs   __all__s   copymodes   copy2s   copystats   syss   _build_cmdtuples   rmtrees   copytrees   copys   os(    (    s   /usr/lib/python2.2/shutil.pys   ? s   !	
