‡Æ
ÓMö9c       sÞ     d  Z  
  d k Z  d k Z  d k Z  h  Z  d d Z  d d d „ Z @ d „  Z E d „  Z S d	 f  d
 „  ƒ  YZ	 d d d „ Z
 *d „  Z 3d „  Z <d „  Z Ge d j o He ƒ  n d S(   s¯   Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=1, use_statcache=0) -> int
    cmpfiles(a, b, common) -> ([], [], [])

Ni   i   c 	   sR   + , | o - t i } n / t i } 0 t | |  ƒ ƒ } 1 t | | ƒ ƒ } 2 | d t i
 j p | d t i
 j o 3 d Sn 4 | o
 | | j o 5 d Sn 6 | d | d j o 7 d Sn 9 t i |  | f ƒ } : | o | | f | d  j o ; | d Sn < t |  | ƒ } = | | | f t |  | f <> | Sd S(   sŠ  Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to 1.

    use_statcache -- Do not stat() each file directly: go through
                     the statcache module for more efficiency.

    Return value:

    integer -- 1 if the files are the same, 0 otherwise.

    This function uses a cache for past comparisons and the results,
    with a cache invalidation mechanism relying on stale signatures.
    Of course, if 'use_statcache' is true, this mechanism is defeated,
    and the cache will never grow stale.

    i    i   i   N(   s   use_statcaches	   statcaches   stats   stat_functions   oss   _sigs   f1s   s1s   f2s   s2s   S_IFREGs   shallows   _caches   gets   results   _do_cmps   outcome(	   s   f1s   f2s   shallows   use_statcaches   stat_functions   s1s   s2s   results   outcomes$   /mit/python/lib/python2.0/filecmp.pys   cmp s$   
+!i   i    c    s5   @ A t  i |  t  i ƒ |  t  i |  t  i f Sd  S(   N(   s   stats   S_IFMTs   sts   ST_MODEs   ST_SIZEs   ST_MTIME(   s   sts$   /mit/python/lib/python2.0/filecmp.pys   _sig@ s   c    sž   E F t  } G t |  d ƒ } H t | d ƒ } I xd I d oY J | i | ƒ } K | i | ƒ } L | | j o M d Sn N | o O d Sn q6 Wd  S(   Ns   rbi   i    (
   s   BUFSIZEs   bufsizes   opens   f1s   fp1s   f2s   fp2s   reads   b1s   b2(   s   f1s   f2s   bufsizes   fp1s   fp2s   b1s   b2s$   /mit/python/lib/python2.0/filecmp.pys   _do_cmpE s   	 
s   dircmpc      sé   S d  Z  s u e e d „ Z  d „  Z ‰ d f Z Š d d d f Z ‹ d d d	 f Z Œ d
 d d f Z  d d f Z  d „  Z	 ž d „  Z
 ² d „  Z Õ d „  Z Ù d „  Z ã d „  Z è d „  Z d „  Z d „  Z RS(   sQ  A class that manages the comparison of 2 directories.

    dircmp(a,b,ignore=None,hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to ['RCS', 'CVS', 'tags'].
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     c    sŒ   u v | |  _ w | |  _ x | t j o y t i t i	 g |  _ n { | |  _ | | t j o } d d d g |  _
 n  | |  _
 d  S(   Ns   RCSs   CVSs   tags(   s   as   selfs   lefts   bs   rights   hides   Nones   oss   curdirs   pardirs   ignore(   s   selfs   as   bs   ignores   hides$   /mit/python/lib/python2.0/filecmp.pys   __init__u s   c    sƒ    ‚ t  t i |  i ƒ ƒ |  i |  i ƒ |  _ „ t  t i |  i ƒ … |  i |  i ƒ |  _	 † |  i i
 ƒ  ‡ |  i	 i
 ƒ  d  S(   N(   s   _filters   oss   listdirs   selfs   lefts   hides   ignores	   left_lists   rights
   right_lists   sort(   s   selfs$   /mit/python/lib/python2.0/filecmp.pys   phase0 s   s   subdirss
   same_filess
   diff_filess   funny_filess   common_dirss   common_filess   common_funnys   commons	   left_onlys
   right_onlys	   left_lists
   right_listc    s×     | |  i j o ‘ |  i ƒ  n ’ | |  i j o “ |  i ƒ  ny ” | |  i j o • |  i ƒ  nU – | |  i j o — |  i	 ƒ  n1 ˜ | |  i
 j o ™ |  i ƒ  n › t | ‚ œ t |  | ƒ Sd  S(   N(   s   attrs   selfs   _dircmp__p4_attrss   phase4s   _dircmp__p3_attrss   phase3s   _dircmp__p2_attrss   phase2s   _dircmp__p1_attrss   phase1s   _dircmp__p0_attrss   phase0s   AttributeErrors   getattr(   s   selfs   attrs$   /mit/python/lib/python2.0/filecmp.pys   __getattr__ s   c    s  ž Ÿ g  g  f \ } }   h  } ¡ h  } ¢ x# |  i d ¢ r } £ d | | <q9 W¤ xM |  i d ¤ r= } ¥ | i	 | d ƒ o ¦ d | | <n ¨ | i
 | ƒ qb W© xC |  i d © r3 } ª | i	 | d ƒ o « n ­ | i
 | ƒ qµ W® | i ƒ  |  _ ¯ | |  _ ° | |  _ d  S(   Ni    i   (   s   a_onlys   b_onlys   commons   bs   selfs
   right_lists   fnms	   left_lists   xs   gets   appends   keyss	   left_onlys
   right_only(   s   selfs   a_onlys   b_onlys   commons   bs   fnms   xs$   /mit/python/lib/python2.0/filecmp.pys   phase1ž s&   		 	 	 	c 
   sç  ² ³ g  |  _ ´ g  |  _ µ g  |  _ · x¶|  i d · r¦} ¸ t i i |  i	 | ƒ } ¹ t i i |  i | ƒ } » d } ¼ y ½ t i | ƒ } Wn$ ¾ t i j
 o } À d } n XÁ y Â t i | ƒ } Wn$ Ã t i j
 o } Å d } n XÇ | oÄ È t i | t i ƒ } É t i | t i ƒ }	 Ê | |	 j o Ë |  i i | ƒ nh Ì t i | ƒ o Í |  i i | ƒ n> Î t i | ƒ o Ï |  i i | ƒ n Ñ |  i i | ƒ n Ó |  i i | ƒ q6 Wd  S(   Ni    i   (   s   selfs   common_dirss   common_filess   common_funnys   commons   xs   oss   paths   joins   lefts   a_paths   rights   b_paths   oks	   statcaches   stats   a_stats   errors   whys   b_stats   S_IFMTs   ST_MODEs   a_types   b_types   appends   S_ISDIRs   S_ISREG(
   s   selfs   xs   a_paths   b_paths   oks   a_stats   whys   b_stats   a_types   b_types$   /mit/python/lib/python2.0/filecmp.pys   phase2² s6    		
c    s@   Õ Ö t  |  i |  i |  i ƒ } × | \ |  _ |  _ |  _ d  S(   N(	   s   cmpfiless   selfs   lefts   rights   common_filess   xxs
   same_filess
   diff_filess   funny_files(   s   selfs   xxs$   /mit/python/lib/python2.0/filecmp.pys   phase3Õ s   c    sŠ   Ù Ý h  |  _ Þ xq |  i d Þ ra } ß t i i |  i | ƒ } à t i i |  i	 | ƒ } á t | | |  i |  i ƒ |  i | <q Wd  S(   Ni    (   s   selfs   subdirss   common_dirss   xs   oss   paths   joins   lefts   a_xs   rights   b_xs   dircmps   ignores   hide(   s   selfs   xs   a_xs   b_xs$   /mit/python/lib/python2.0/filecmp.pys   phase4Ù s    	c    sJ   ã ä |  i ƒ  å x0 |  i i ƒ  d å r } æ |  i | i ƒ  q% Wd  S(   Ni    (   s   selfs   phase4s   subdirss   keyss   xs   phase4_closure(   s   selfs   xs$   /mit/python/lib/python2.0/filecmp.pys   phase4_closureã s    	c    sƒ  è ê d G|  i G|  i GHë |  i o. ì |  i i ƒ  í d G|  i Gd G|  i GHn î |  i o. ï |  i i ƒ  ð d G|  i Gd G|  i GHn ñ |  i o# ò |  i i ƒ  ó d G|  i GHn ô |  i o# õ |  i i ƒ  ö d G|  i GHn ÷ |  i o# ø |  i i ƒ  ù d G|  i GHn ú |  i	 o# û |  i	 i ƒ  ü d G|  i	 GHn ý |  i
 o# þ |  i
 i ƒ  ÿ d G|  i
 GHn d  S(	   Ns   diffs   Only ins   :s   Identical files :s   Differing files :s   Trouble with common files :s   Common subdirectories :s   Common funny cases :(   s   selfs   lefts   rights	   left_onlys   sorts
   right_onlys
   same_filess
   diff_filess   funny_filess   common_dirss   common_funny(   s   selfs$   /mit/python/lib/python2.0/filecmp.pys   reportè s,   c    sN   |  i ƒ  x4 |  i i ƒ  d r } H|  i | i ƒ  q% Wd  S(   Ni    (   s   selfs   reports   subdirss   keyss   x(   s   selfs   xs$   /mit/python/lib/python2.0/filecmp.pys   report_partial_closures
    	c    sN   |  i ƒ  	x4 |  i i ƒ  d 	r } 
H|  i | i ƒ  q% Wd  S(   Ni    (   s   selfs   reports   subdirss   keyss   xs   report_full_closure(   s   selfs   xs$   /mit/python/lib/python2.0/filecmp.pys   report_full_closures
    	(   s   __doc__s   Nones   __init__s   phase0s   _dircmp__p4_attrss   _dircmp__p3_attrss   _dircmp__p2_attrss   _dircmp__p1_attrss   _dircmp__p0_attrss   __getattr__s   phase1s   phase2s   phase3s   phase4s   phase4_closures   reports   report_partial_closures   report_full_closure(    s$   /mit/python/lib/python2.0/filecmp.pys   dircmpS s"   	 #
c 	   s   g  g  g  f } xf | d rY } t i i |  | ƒ } t i i | | ƒ }  | t
 | | | | ƒ i | ƒ q$ W!| Sd S(   s¥  Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information
    use_statcache -- if true, use statcache.stat() instead of os.stat()

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    i    N(   s   ress   commons   xs   oss   paths   joins   as   axs   bs   bxs   _cmps   shallows   use_statcaches   append(	   s   as   bs   commons   shallows   use_statcaches   ress   xs   axs   bxs$   /mit/python/lib/python2.0/filecmp.pys   cmpfiless    	'c    sH   *+y ,t  t |  | ƒ ƒ SWn  -t i j
 o .d Sn Xd  S(   Ni   (   s   abss   cmps   as   bs   oss   error(   s   as   bs$   /mit/python/lib/python2.0/filecmp.pys   _cmp*s   c    sT   34g  } 5x7 |  d 5r* } 6| | j o 6| i | ƒ n q W7| Sd  S(   Ni    (   s   results   lists   items   skips   append(   s   lists   skips   results   items$   /mit/python/lib/python2.0/filecmp.pys   _filter3s   	 	 c     s¸   <=d  k  }  >d  k } ?| i |  i d d ƒ \ } } @t | ƒ d j o @| i d ‚ n At | d | d ƒ } Bd d f | j o C| i	 ƒ  n E| i
 ƒ  d  S(   Ni   s   ri   s   need exactly two argsi    s   -rs    (   s   syss   getopts   argvs   optionss   argss   lens   errors   dircmps   dds   report_full_closures   report(   s   syss   getopts   optionss   argss   dds$   /mit/python/lib/python2.0/filecmp.pys   demo<s   " s   __main__(   s   __doc__s   oss   stats	   statcaches   _caches   BUFSIZEs   cmps   _sigs   _do_cmps   dircmps   cmpfiless   _cmps   _filters   demos   __name__(    s$   /mit/python/lib/python2.0/filecmp.pys   ?
 s   	-»		