o
    O6uf7  ã                   @   s`   d dl Z d dlZd dlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZdS )é    N)ÚSoSObfuscationArchivec                   @   ó$   e Zd ZdZdZdZedd„ ƒZdS )ÚSoSReportArchivez€This is the class representing an sos report, or in other words the
    type the archive the SoS project natively generates
    Úreportzsos report archivec                 C   ó*   z
t  |¡o	d|v W S  ty   Y dS w )Nú
sosreport-F©ÚtarfileÚ
is_tarfileÚ	Exception©ÚclsÚarc_path© r   ú:/usr/lib/python3/dist-packages/sos/cleaner/archives/sos.pyÚcheck_is_type   ó
   ÿzSoSReportArchive.check_is_typeN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	type_nameÚdescriptionÚclassmethodr   r   r   r   r   r      ó    r   c                   @   r   )ÚSoSReportDirectoryz˜This is the archive class representing a build directory, or in other
    words what `sos report --clean` will end up using for in-line obfuscation
    Ú
report_dirzsos report directoryc                 C   s   t j |¡rdt  |¡v S dS )NÚsos_logsF©ÚosÚpathÚisdirÚlistdirr   r   r   r   r   )   s   z SoSReportDirectory.check_is_typeNr   r   r   r   r   r   !   r   r   c                   @   s0   e Zd ZdZdZdZdZedd„ ƒZdd„ Z	d	S )
ÚSoSCollectorArchivezÛArchive class representing the tarball created by ``sos collect``. It
    will not provide prep files on its own, however it will provide a list
    of SoSReportArchive's which will then be used to prep the parsers
    Úcollectzsos collect tarballTc                 C   r   )Nzsos-collectFr   r   r   r   r   r   :   r   z!SoSCollectorArchive.check_is_typec                 C   s\   | j dd� | j}g }t |¡D ]}tj ||¡}d|v r+t |¡r+| t	|| j
ƒ¡ q|S )NT)Úquietr   )ÚextractÚextracted_pathr    r#   r!   Újoinr	   r
   Úappendr   Útmpdir)ÚselfÚ_pathÚarchivesÚfnameÚarc_namer   r   r   Úget_nested_archivesA   s   €z'SoSCollectorArchive.get_nested_archivesN)
r   r   r   r   r   r   Ú	is_nestedr   r   r1   r   r   r   r   r$   0   s    
r$   c                   @   r   )ÚSoSCollectorDirectoryz{The archive class representing the temp directory used by ``sos
    collect`` when ``--clean`` is used during runtime.
    Úcollect_dirzsos collect directoryc                 C   s.   t j |¡rt  |¡D ]	}d|v r dS qdS )Nzsos-collector-TFr   )r   r   r/   r   r   r   r   T   s   ÿz#SoSCollectorDirectory.check_is_typeNr   r   r   r   r   r3   L   r   r3   )r    r	   Úsos.cleaner.archivesr   r   r   r$   r3   r   r   r   r   Ú<module>   s   
