%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/sos/cleaner/archives/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/sos/cleaner/archives/__pycache__/__init__.cpython-312.pyc |
� i��dN; � �f � d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z d� Z G d� d� Zy)� N)�ProcessPoolExecutor)�file_is_binaryc �J � t j | � }t j j |d� }|j |� |j � t j j ||j j d� d j d� d � S )N�cleaner�/����.tarr ) �tarfile�open�os�path�join� extractall�close�name�split)�archive_path�tmpdir�archiver s �?/usr/lib/python3/dist-packages/sos/cleaner/archives/__init__.py�extract_archiver st � ��l�l�<�(�G� �7�7�<�<�� �*�D����t���M�M�O� �7�7�<�<��g�l�l�0�0��5�b�9�?�?��G��J�K�K� c � � e Zd ZdZg ZdZdZdZdZdZ g Z i Zd� Ze d� � Zed� � Zed� � Zd � Zd � Zd� Zd� Zd � Zd� Zd� Zd� Zed� � Zd� Zd� Zd� Zd$d�Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$d� Z%d� Z&d� Z'd� Z(d � Z)d!� Z*d"� Z+y#)%�SoSObfuscationArchivea A representation of an extracted archive or an sos archive build directory which is used by SoSCleaner. Each archive that needs to be obfuscated is loaded into an instance of this class. All report-level operations should be contained within this class. r �undeterminedFc �� � || _ | j | _ || _ | j j d� d j d� d | _ | j | _ t j d� | _ t j d� | _ | j � | _ d| _ | j � d| _ | j d | j �d | j ��� y )Nr r r r �sos�sos_uiF� zLoaded z as type )r �final_archive_pathr r �archive_name�ui_name�logging� getLogger�soslog�ui_log�_load_skip_list� skip_list�is_extracted� _load_self�archive_root�log_info�description)�selfr r s r �__init__zSoSObfuscationArchive.__init__2 s� � �(���"&�"3�"3������ �-�-�3�3�C�8��<�B�B�6�J�1�M����(�(����'�'��.����'�'��1����-�-�/���!����������� � �� � �$�"2�"2� 4� r c � � y)z=Check if the archive is a well-known type we directly supportF� )�cls�arc_paths r � check_is_typez#SoSObfuscationArchive.check_is_typeC s � � r c �N � d| j j j � v S )Nr )� __class__�__name__�lower�r. s r �is_soszSoSObfuscationArchive.is_sosH s � �����/�/�5�5�7�7�7r c � � d| j v S )N�insights)� type_namer9 s r �is_insightsz!SoSObfuscationArchive.is_insightsL s � ��T�^�^�+�+r c �f � | j r%t j | j � | _ y y �N)� is_tarfiler r r �tarobjr9 s r r* z SoSObfuscationArchive._load_selfP s$ � ��?�?�!�,�,�t�'8�'8�9�D�K� r c � � g S )a/ Return a list of ObfuscationArchives that represent additional archives found within the target archive. For example, an archive from `sos collect` will return a list of ``SoSReportArchive`` objects. This should be overridden by individual types of ObfuscationArchive's r1 r9 s r �get_nested_archivesz)SoSObfuscationArchive.get_nested_archivesT s � � � r c �� � | j rB| j j }|j � r|j S t j S t j j | j � S )z|Set the root path for the archive that should be prepended to any filenames given to methods in this class. ) rA rB �firstmember�isdirr r �sepr �abspathr )r. �toplevels r �get_archive_rootz&SoSObfuscationArchive.get_archive_root] sP � � �?�?��{�{�.�.�H��~�~���}�}�$��v�v� ��w�w���t�0�0�1�1r c �t � | j j dj | j dz |� � y)z9Helper to easily format ui messages on a per-report basisz {:<50} {}z :N)r&