???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ž
§ÿf}%  c               @   sÖ   d  Z  d d l Z d d l Z d d l m Z d d d g Z i  Z d Z d d	 d „ Z	 d
 d „  Z
 d d „  Z Gd d „  d ƒ Z d d d „ Z e e	 d d „ Z d d „  Z d d „  Z e d k rÒ e ƒ  n  d S(   u¡   Utilities for comparing files and directories.

Classes:
    dircmp

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

i    N(   u   filterfalseu   cmpu   dircmpu   cmpfilesi   i   c             C   sô   t  t j |  ƒ ƒ } t  t j | ƒ ƒ } | d t j k sP | d t j k rT d S| rj | | k rj d S| d | d k r‚ d St j |  | | | f ƒ } | d k rð t	 |  | ƒ } t
 t ƒ d k r× t j ƒ  n  | t |  | | | f <n  | S(   u”  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.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with a cache invalidation mechanism relying on stale signatures.

    i    i   id   FTN(   u   _sigu   osu   statu   S_IFREGu   Falseu   Trueu   _cacheu   getu   Noneu   _do_cmpu   lenu   clear(   u   f1u   f2u   shallowu   s1u   s2u   outcome(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   cmp   s    &c             C   s   t  j |  j ƒ |  j |  j f S(   N(   u   statu   S_IFMTu   st_modeu   st_sizeu   st_mtime(   u   st(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   _sig;   s    u   _sigc             C   sx   t  } t |  d ƒ ] } t | d ƒ E } x; | j | ƒ } | j | ƒ } | | k r[ d S| s- d Sq- Wd  QXWd  QXd  S(   Nu   rbFT(   u   BUFSIZEu   openu   readu   Falseu   True(   u   f1u   f2u   bufsizeu   fp1u   fp2u   b1u   b2(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   _do_cmp@   s    $u   _do_cmpc             B   sõ   |  Ee  Z d  Z d Z d$ d$ d d „ Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z	 d d „  Z
 d d „  Z d d „  Z d d „  Z d d „  Z e d e
 d e	 d e	 d e	 d e d e d e d e d e d e d  e d! e ƒ Z d" d# „  Z d$ S(%   u   dircmpuT  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             C   sm   | |  _  | |  _ | d  k r6 t j t j g |  _ n	 | |  _ | d  k r` d d d g |  _ n	 | |  _ d  S(   Nu   RCSu   CVSu   tags(   u   leftu   rightu   Noneu   osu   curdiru   pardiru   hideu   ignore(   u   selfu   au   bu   ignoreu   hide(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   __init__o   s    			u   dircmp.__init__c             C   sn   t  t j |  j ƒ |  j |  j ƒ |  _ t  t j |  j ƒ |  j |  j ƒ |  _ |  j j	 ƒ  |  j j	 ƒ  d  S(   N(
   u   _filteru   osu   listdiru   leftu   hideu   ignoreu	   left_listu   rightu
   right_listu   sort(   u   self(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase0{   s    u   dircmp.phase0c             C   sÍ   t  t t t j j |  j ƒ |  j ƒ ƒ } t  t t t j j |  j ƒ |  j ƒ ƒ } t t | j	 t
 | j | ƒ ƒ ƒ |  _ t t | j	 t | j | ƒ ƒ ƒ |  _ t t | j	 t | j | ƒ ƒ ƒ |  _ d  S(   N(   u   dictu   zipu   mapu   osu   pathu   normcaseu	   left_listu
   right_listu   listu   __getitem__u   filteru   __contains__u   commonu   filterfalseu	   left_onlyu
   right_only(   u   selfu   au   b(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase1ƒ   s
    **''u   dircmp.phase1c       
      C   s¡  g  |  _  g  |  _ g  |  _ x|  j D]t} t j j |  j | ƒ } t j j |  j | ƒ } d } y t j	 | ƒ } Wn. t j
 k
 r¤ } z d } WYd  d  } ~ Xn Xy t j	 | ƒ } Wn. t j
 k
 rè } z d } WYd  d  } ~ Xn X| r‰t	 j | j ƒ } t	 j | j ƒ }	 | |	 k r2|  j j | ƒ q™t	 j | ƒ rT|  j  j | ƒ q™t	 j | ƒ rv|  j j | ƒ q™|  j j | ƒ q% |  j j | ƒ q% Wd  S(   Ni   i    (   u   common_dirsu   common_filesu   common_funnyu   commonu   osu   pathu   joinu   leftu   rightu   statu   erroru   S_IFMTu   st_modeu   appendu   S_ISDIRu   S_ISREG(
   u   selfu   xu   a_pathu   b_pathu   oku   a_statu   whyu   b_statu   a_typeu   b_type(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase2Š   s4    			u   dircmp.phase2c             C   s7   t  |  j |  j |  j ƒ } | \ |  _ |  _ |  _ d  S(   N(   u   cmpfilesu   leftu   rightu   common_filesu
   same_filesu
   diff_filesu   funny_files(   u   selfu   xx(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase3­   s    u   dircmp.phase3c             C   ss   i  |  _  xc |  j D]X } t j j |  j | ƒ } t j j |  j | ƒ } t | | |  j |  j	 ƒ |  j  | <q Wd  S(   N(
   u   subdirsu   common_dirsu   osu   pathu   joinu   leftu   rightu   dircmpu   ignoreu   hide(   u   selfu   xu   a_xu   b_x(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase4±   s
    	u   dircmp.phase4c             C   s2   |  j  ƒ  x! |  j j ƒ  D] } | j ƒ  q Wd  S(   N(   u   phase4u   subdirsu   valuesu   phase4_closure(   u   selfu   sd(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   phase4_closure»   s    
u   dircmp.phase4_closurec             C   sK  t  d |  j |  j ƒ |  j rH |  j j ƒ  t  d |  j d |  j ƒ n  |  j rz |  j j ƒ  t  d |  j d |  j ƒ n  |  j r£ |  j j ƒ  t  d |  j ƒ n  |  j rÌ |  j j ƒ  t  d |  j ƒ n  |  j rõ |  j j ƒ  t  d |  j ƒ n  |  j	 r|  j	 j ƒ  t  d |  j	 ƒ n  |  j
 rG|  j
 j ƒ  t  d |  j
 ƒ n  d  S(	   Nu   diffu   Only inu   :u   Identical files :u   Differing files :u   Trouble with common files :u   Common subdirectories :u   Common funny cases :(   u   printu   leftu   rightu	   left_onlyu   sortu
   right_onlyu
   same_filesu
   diff_filesu   funny_filesu   common_dirsu   common_funny(   u   self(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   reportÀ   s,    							u   dircmp.reportc             C   s9   |  j  ƒ  x( |  j j ƒ  D] } t ƒ  | j  ƒ  q Wd  S(   N(   u   reportu   subdirsu   valuesu   print(   u   selfu   sd(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   report_partial_closureÙ   s    
u   dircmp.report_partial_closurec             C   s9   |  j  ƒ  x( |  j j ƒ  D] } t ƒ  | j ƒ  q Wd  S(   N(   u   reportu   subdirsu   valuesu   printu   report_full_closure(   u   selfu   sd(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   report_full_closureß   s    
u   dircmp.report_full_closureu   subdirsu
   same_filesu
   diff_filesu   funny_filesu   common_dirsu   common_filesu   common_funnyu   commonu	   left_onlyu
   right_onlyu	   left_listu
   right_listc             C   s<   | |  j  k r t | ƒ ‚ n  |  j  | |  ƒ t |  | ƒ S(   N(   u	   methodmapu   AttributeErroru   getattr(   u   selfu   attr(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   __getattr__ë   s    u   dircmp.__getattr__N(   u   __name__u
   __module__u   __qualname__u   __doc__u   Noneu   __init__u   phase0u   phase1u   phase2u   phase3u   phase4u   phase4_closureu   reportu   report_partial_closureu   report_full_closureu   dictu	   methodmapu   __getattr__(   u
   __locals__(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   dircmpM   s"    #
c             C   sk   g  g  g  f } xU | D]M } t  j j |  | ƒ } t  j j | | ƒ } | t | | | ƒ j | ƒ q W| S(   u]  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

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

    (   u   osu   pathu   joinu   _cmpu   append(   u   au   bu   commonu   shallowu   resu   xu   axu   bx(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   cmpfilesñ   s    !c             C   s;   y | | |  | | ƒ ƒ SWn t  j k
 r6 d SYn Xd  S(   Ni   (   u   osu   error(   u   au   bu   shu   absu   cmp(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   _cmp  s    u   _cmpc             C   s   t  t | j |  ƒ ƒ S(   N(   u   listu   filterfalseu   __contains__(   u   flistu   skip(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   _filter  s    u   _filterc              C   s¢   d d  l  }  d d  l } | j |  j d d  … d ƒ \ } } t | ƒ d k rd | j d d  ƒ ‚ n  t | d | d ƒ } d | k r” | j ƒ  n
 | j ƒ  d  S(	   Ni    i   u   ri   u   need exactly two argsu   -ru    (   u   -ru    (	   u   sysu   getoptu   argvu   lenu   GetoptErroru   Noneu   dircmpu   report_full_closureu   report(   u   sysu   getoptu   optionsu   argsu   dd(    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   demo  s    %u   demou   __main__i    T(   u   __doc__u   osu   statu	   itertoolsu   filterfalseu   __all__u   _cacheu   BUFSIZEu   Trueu   cmpu   _sigu   _do_cmpu   dircmpu   cmpfilesu   absu   _cmpu   _filteru   demou   __name__(    (    (    u,   /opt/alt/python33/lib64/python3.3/filecmp.pyu   <module>
   s    &¤	