o id8 @s`ddlmZddlZddlZGdddeZGdddeZGdddeZGd d d eZdS) )SoSObfuscationArchiveNc@$eZdZdZdZdZeddZdS)SoSReportArchivezThis is the class representing an sos report, or in other words the type the archive the SoS project natively generates reportzsos report archivecC*z t|o d|vWStyYdSw)N sosreport-Ftarfile is_tarfile Exceptionclsarc_pathr:/usr/lib/python3/dist-packages/sos/cleaner/archives/sos.py check_is_type  zSoSReportArchive.check_is_typeN__name__ __module__ __qualname____doc__ type_name description classmethodrrrrrr rc@r)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_dirzsos report directorycCstj|r dt|vSdS)Nsos_logsFospathisdirlistdirr rrrr*s z SoSReportDirectory.check_is_typeNrrrrrr"rrc@s0eZdZdZdZdZdZeddZddZ d S) 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 collectzsos collect tarballTcCr)Nz sos-collectFrr rrrr;rz!SoSCollectorArchive.check_is_typecCs\|jdd|j}g}t|D]}tj||}d|vr+t|r+|t ||j q|S)NT)quietr) extractextracted_pathr r#r!joinr r appendrtmpdir)self_patharchivesfnamearc_namerrrget_nested_archivesBs z'SoSCollectorArchive.get_nested_archivesN) rrrrrr is_nestedrrr1rrrrr$1s  r$c@r)SoSCollectorDirectoryz{The archive class representing the temp directory used by ``sos collect`` when ``--clean`` is used during runtime. collect_dirzsos collect directorycCs.tj|rt|D] }d|vrdSq dS)Nzsos-collector-TFr)r rr/rrrrUs z#SoSCollectorDirectory.check_is_typeNrrrrrr3Mrr3)sos.cleaner.archivesrr r rrr$r3rrrrs