OwlCyberSecurity - MANAGER
Edit File: filecmp.cpython-311.opt-1.pyc
� �����/�g�'�����������������������������d�Z�ddlZddlZddlmZ�ddlmZ�g�d�Zi�ZdZ g�d�Z d��Zdd �Zd��Z d��Z�G�d ��d������������Zdd�Zeefd�Zd��Zd��Zedk����r�e���������������dS�dS�)z�Utilities for comparing files and directories. Classes: dircmp Functions: cmp(f1, f2, shallow=True) -> int cmpfiles(a, b, common) -> ([], [], []) clear_cache() �����N)�filterfalse)�GenericAlias)�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi� ��)�RCS�CVS�tagsz.gitz.hgz.bzr�_darcs�__pycache__c�������������������8�����t�����������������������������������������������dS�)zClear the filecmp cache.N)�_cache�clear��������./opt/alt/python311/lib64/python3.11/filecmp.pyr���r������s������ �L�L�N�N�N�N�Nr���Tc�����������������������t����������t����������j��������|�������������������������}t����������t����������j��������|������������������������}|d���������t����������j��������k����s|d���������t����������j��������k����rdS�|r||k����rdS�|d���������|d���������k����rdS�t�������������������������������|�|||f������������}|�Dt ����������|�|������������}t����������t����������������������dk����rt�������������������������|t����������|�|||f<���|S�)aM��Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- treat files as identical if their stat signatures (type, size, mtime) are identical. Otherwise, files are considered different if their sizes or contents differ. [default: True] Return value: True if the files are the same, False otherwise. This function uses a cache for past comparisons and the results, with cache entries invalidated if their stat information changes. The cache may be cleared by calling clear_cache(). r���FT����N�d���) �_sig�os�stat�S_IFREGr����get�_do_cmp�lenr���)�f1�f2�shallow�s1�s2�outcomes��� r���r���r������s�������.� �b�g�b�k�k� � �B� �b�g�b�k�k� � �B� �!�u������1���� 5� 5��u����2��8�8��t� �!�u��1��~�~��u��j�j�"�b�"�b�)�*�*�G����"�b�/�/���v�;�;�����M�M�M�!(��r�2�r�2�~���Nr���c������������������N�����t����������j��������|�j��������������������|�j��������|�j��������fS��N)r����S_IFMT�st_mode�st_size�st_mtime)�sts��� r���r���r���F���s%�������K�� �#�#��J��K���r���c������������������j����t�����������}t����������|�d������������5�}t����������|d������������5�} �|���������������������|������������}|���������������������|������������}||k����r �d�d�d��������������d�d�d��������������dS�|s �d�d�d��������������d�d�d��������������dS��e#�1�swxY�w�Y���d�d�d��������������d�S�#�1�swxY�w�Y���d�S�)N�rbTF)�BUFSIZE�open�read)r���r ����bufsize�fp1�fp2�b1�b2s��� r���r���r���K���s�������G� �b�$�����3��R������#� ����'�"�"�B����'�"�"�B��R�x�x�������������������������������� ����������������������������� ���������������������������������������������������������sF����B(�3B�B(�4B�7B(�B�B �B(�B �B(�(B,�/B,c�������������������������e�Zd�ZdZdd�Zd��Zd��Zd��Zd��Zd��Z d ��Z d ��Zd��Zd��Z �ee eeeeeeeeeee� ������������Zd��Z�ee������������ZdS�)r���a���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 DEFAULT_IGNORES. 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 instances (or MyDirCmp instances if this object is of type MyDirCmp, a subclass of dircmp), keyed by names in common_dirs. Nc�����������������������||�_���������||�_��������|�t����������j��������t����������j��������g|�_��������n||�_��������|�t����������|�_��������d�S�||�_��������d�S�r&���)�left�rightr����curdir�pardir�hider ����ignore)�self�a�br=���r<���s��� r����__init__zdircmp.__init__|���sI�������� ��� ��<���B�I�.�D�I�I��D�I��>�)�D�K�K�K� �D�K�K�Kr���c������������������N����t����������t����������j��������|�j��������������������|�j��������|�j��������z���������������|�_��������t����������t����������j��������|�j��������������������|�j��������|�j��������z���������������|�_��������|�j��������� �����������������������������������|�j��������� �����������������������������������d�S�r&���) �_filterr����listdirr8���r<���r=���� left_listr9���� right_list�sort�r>���s��� r����phase0z dircmp.phase0����s������� ���D�I�!6�!6�!%��4�;�!6�8��8���!�"�*�T�Z�"8�"8�"&�)�D�K�"7�9��9������������������r���c����������� �������r����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�r&���)�dict�zip�mapr����path�normcaserE���rF����list�__getitem__�filter�__contains__�commonr���� left_only� right_only)r>���r?���r@���s��� r����phase1z dircmp.phase1����s���������S���)�4�>�:�:�D�N�K�K�L�L����S���)�4�?�;�;�T�_�M�M�N�N���3�q�}�f�Q�^�Q�.G�.G�H�H�I�I����c�!�-��Q�^�Q�1O�1O�P�P�Q�Q����s�1�=�+�a�n�a�2P�2P�Q�Q�R�R����r���c������������������V����g�|�_���������g�|�_��������g�|�_��������|�j��������D��]�}t����������j�����������������������������|�j��������|������������}t����������j�����������������������������|�j��������|������������}d} �t ����������j ��������|������������}n#�t����������$�r�d}Y�nw�xY�w �t ����������j ��������|������������}n#�t����������$�r�d}Y�nw�xY�w|r�t����������j��������|j��������������������}t����������j��������|j��������������������}||k����r|�j��������� ��������������������|���������������t����������j��������|������������r|�j���������� ��������������������|���������������$t����������j��������|������������r|�j��������� ��������������������|���������������T|�j��������� ��������������������|���������������p|�j��������� ��������������������|����������������d�S�)Nr���r���)�common_dirs�common_files�common_funnyrT���r���rN����joinr8���r9���r����OSErrorr'���r(����append�S_ISDIR�S_ISREG) r>����x�a_path�b_path�ok�a_stat�b_stat�a_type�b_types ��� r����phase2z dircmp.phase2����s������������������ ,�� ,�A��W�\�\�$�)�Q�/�/�F��W�\�\�$�*�a�0�0�F��B� ����������� �� �� ����� ���� ����������� �� �� ����� ������� ,���V�^�4�4����V�^�4�4���V�#�#��%�,�,�Q�/�/�/�/��\�&�)�)��0��$�+�+�A�.�.�.�.��\�&�)�)��0��%�,�,�Q�/�/�/�/��%�,�,�Q�/�/�/�/��!�(�(��+�+�+�+�9 ,�� ,s$����-B�B�B�B*�*B9�8B9c������������������p�����t����������|�j��������|�j��������|�j��������������������}|\��|�_��������|�_��������|�_��������d�S�r&���)r���r8���r9���rZ���� same_files� diff_files�funny_files)r>����xxs��� r����phase3z dircmp.phase3����s3������ �d�i���T�->� ?� ?��=?�:�����$�*:�*:�*:r���c����������������������i�|�_���������|�j��������D�]v}t����������j�����������������������������|�j��������|������������}t����������j�����������������������������|�j��������|������������}|����������������������|||�j��������|�j ��������������������|�j���������|<����wd�S�r&���) �subdirsrY���r���rN���r\���r8���r9���� __class__r=���r<���)r>���ra����a_x�b_xs��� r����phase4z dircmp.phase4����s|������ �����!�� P�� P�A��'�,�,�t�y�!�,�,�C��'�,�,�t�z�1�-�-�C�#�~�~�c�3���T�Y�O�O�D�L��O�O� P�� Pr���c�����������������������|��������������������������������������|�j�������������������������������������������D�]}|�������������������������������������d�S�r&���)ru���rq����values�phase4_closure�r>����sds��� r���rx���zdircmp.phase4_closure����sK��������� � � ��,�%�%�'�'�� �� �B�������� �� r���c������������������B����t����������d|�j��������|�j���������������������|�j��������r5|�j��������������������������������������������t����������d|�j��������d|�j���������������������|�j��������r5|�j��������������������������������������������t����������d|�j��������d|�j���������������������|�j��������r.|�j��������������������������������������������t����������d|�j���������������������|�j��������r.|�j��������������������������������������������t����������d|�j���������������������|�j��������r.|�j��������������������������������������������t����������d|�j���������������������|�j ��������r.|�j ��������������������������������������������t����������d|�j ���������������������|�j ��������r0|�j ��������������������������������������������t����������d|�j ���������������������d�S�d�S�) N�diffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr8���r9���rU���rG���rV���rk���rl���rm���rY���r[���rH���s��� r����reportz dircmp.report����s������ �f�d�i���,�,�,��>�� =��N���!�!�!��)�T�Y��T�^�<�<�<��?�� ?��O� � �"�"�"��)�T�Z��d�o�>�>�>��?�� 8��O� � �"�"�"��%�t��7�7�7��?�� 8��O� � �"�"�"��%�t��7�7�7���� C���!�!�#�#�#��/��1A�B�B�B���� ?���!�!�#�#�#��+�T�-=�>�>�>���� =���"�"�$�$�$��(�$�*;�<�<�<�<�<� =�� =r���c�����������������������|��������������������������������������|�j�������������������������������������������D�]$}t�������������������������|��������������������������������������%d�S�r&���)r���rq���rw���r~���ry���s��� r����report_partial_closurezdircmp.report_partial_closure����sN��������� � � ��,�%�%�'�'�� �� �B��G�G�G��I�I�K�K�K�K� �� r���c�����������������������|��������������������������������������|�j�������������������������������������������D�]$}t�������������������������|�������������������������������������%d�S�r&���)r���rq���rw���r~����report_full_closurery���s��� r���r����zdircmp.report_full_closure����sT��������� � � ��,�%�%�'�'�� %�� %�B��G�G�G��"�"�$�$�$�$� %�� %r���)rq���rk���rl���rm���rY���rZ���r[���rT���rU���rV���rE���rF���c������������������~�����||�j���������vrt����������|��������������|�j���������|���������|��������������t����������|�|������������S�r&���)� methodmap�AttributeError�getattr)r>����attrs��� r����__getattr__zdircmp.__getattr__����sD�������t�~�%�%� ��&�&�&����t��T�"�"�"��t�T�"�"�"r���)NN)�__name__� __module__�__qualname__�__doc__rA���rI���rW���ri���ro���ru���rx���r���r����r����rK���r����r�����classmethodr����__class_getitem__r���r���r���r���r���X���s�������������! ��! �F !�� !�� !�� !������S��S��S�!,��!,��!,�F@��@��@� P�� P�� P� �� �� � =��=��=�2�����%��%��%����V� &�6�v�#)��V�"�f��%�&� :��:��:�I�#��#��#��$��L�1�1���r���r���c������������������������g�g�g�f}|D�]l}t�����������j�����������������������������|�|������������}t�����������j�����������������������������||������������}|t����������|||������������������������������������������|��������������m|S�)a]��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. )r���rN���r\����_cmpr^���)r?���r@���rT���r!����resra����ax�bxs��� r���r���r�����su��������r�2�,�C� ��-��-�� �W�\�\�!�Q� � �� �W�\�\�!�Q� � ���D��R��!�!�"�)�)�!�,�,�,�,��Jr���c������������������T����� ��|�||�||�������������������������S�#�t�����������$�r�Y�dS�w�xY�w)N����)r]���)r?���r@����sh�absr���s��� r���r����r������sH��������3�s�s�1�a��}�}�%�%�%�%����������q�q����s������ '�'c������������������F�����t����������t����������|j��������|�������������������������S�r&���)rP���r���rS���)�flist�skips��� r���rC���rC���&��s��������D�-�u�5�5�6�6�6r���c�������������������H����dd�l�}�dd�l}|���������������������|�j��������dd�����������d������������\��}}t����������|������������dk����r|���������������������dd��������������t����������|d���������|d���������������������}d|v�r|������������������������������������d�S�|������������������������������������d�S�)Nr���r����rr����zneed exactly two args)z-r��)�sys�getopt�argvr����GetoptErrorr���r����r���)r����r�����options�args�dds��� r����demor����,��s��������J�J�J��M�M�M��M�M�#�(�1�2�2�,��4�4�M�G�T� �4�y�y�A�~�~�� � �!8�$�?�?�?� ��Q���a�� !� !�B��W��� ��� � � � � � � � �����r����__main__)T)r����r���r���� itertoolsr����typesr����__all__r���r.���r ���r���r���r���r���r���r���r����r����rC���r����r����r���r���r����<module>r�������sT���� �� �� � � � �������!��!��!��!��!��!������������� I� I� I�� �� ��J��J��J�������&��&��&��&�P����� �� �� �g2��g2��g2��g2��g2��g2��g2��g2�T�������6�����������7��7��7� �� �� ���z����D�F�F�F�F�F���r���