
    -_g7                     x    d dl Z d dlZd dlmZ  G d de      Z G d de      Z G d de      Z G d	 d
e      Zy)    N)SoSObfuscationArchivec                   (    e Zd ZdZdZdZed        Zy)SoSReportArchivezThis is the class representing an sos report, or in other words the
    type the archive the SoS project natively generates
    reportzsos report archivec                 X    	 t        j                  |      xr d|v S # t        $ r Y yw xY w)N
sosreport-Ftarfile
is_tarfile	Exceptionclsarc_paths     :/usr/lib/python3/dist-packages/sos/cleaner/archives/sos.pycheck_is_typezSoSReportArchive.check_is_type   s4    	%%h/LLH4LL 		    	))N__name__
__module____qualname____doc__	type_namedescriptionclassmethodr        r   r   r      s%     I&K r   r   c                   (    e Zd ZdZdZdZed        Zy)SoSReportDirectoryzThis 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                 p    t         j                  j                  |      rdt        j                  |      v S y)Nsos_logsFospathisdirlistdirr   s     r   r   z SoSReportDirectory.check_is_type)   s)    77=="H!555r   Nr   r   r   r   r   r   !   s%     I(K r   r   c                   2    e Zd ZdZdZdZdZed        Zd Z	y)SoSCollectorArchivezArchive 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                 X    	 t        j                  |      xr d|v S # t        $ r Y yw xY w)Nzsos-collectFr	   r   s     r   r   z!SoSCollectorArchive.check_is_type:   s4    	&&x0N]h5NO 		r   c                 :   | j                  d       | j                  }g }t        j                  |      D ]b  }t        j                  j                  ||      }d|v s(t        j                  |      s>|j                  t        || j                               d |S )NT)quietr   )extractextracted_pathr#   r&   r$   joinr
   r   appendr   tmpdir)self_patharchivesfnamearc_names        r   get_nested_archivesz'SoSCollectorArchive.get_nested_archivesA   s    4 ##ZZ& 	IEww||E51Hu$););H)E 04;; GH	I r   N)
r   r   r   r   r   r   	is_nestedr   r   r7   r   r   r   r(   r(   0   s/    
 I'KI r   r(   c                   (    e Zd ZdZdZdZed        Zy)SoSCollectorDirectoryz{The archive class representing the temp directory used by ``sos
    collect`` when ``--clean`` is used during runtime.
    collect_dirzsos collect directoryc                     t         j                  j                  |      r t        j                  |      D ]  }d|v s y y)Nzsos-collector-TFr"   )r   r   r5   s      r   r   z#SoSCollectorDirectory.check_is_typeT   s:    77=="H-  #u,  r   Nr   r   r   r   r:   r:   L   s%     I)K r   r:   )r#   r
   sos.cleaner.archivesr   r   r   r(   r:   r   r   r   <module>r>      sD    
  6,  ) / 8/ r   