Current File : //lib/python2.7/site-packages/sos/plugins/unpackaged.pyc
�
u��ec@sKddlmZmZddlZddlZdeefd��YZdS(i����(tPlugintRedHatPluginNt
UnpackagedcBseZdZd�ZRS(sR
    Collects a list of files that are not handled by the package
    manager
    c
Cs�d�}dd�}d�}|jdt�s4dSg}td�|jj|jjj��D��}x!|�D]}|||�7}qrWg|D]}||kr�|^q�}||�}	|jdj	|	�d�dS(NcSstjdjd�S(s3Return a list of directories in $PATH.
            tPATHt:(tostenvirontsplit(((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pytget_env_path_listsc	SsCg}x6tj|dt�D]\}}}|rkx7|D],}g|D]}||krE|^qE|(q8Wnx�|D]�}tjj||�}yAx:tjtj|�j�r�tjj	tj
|��}q�WWntk
r�qrnX|jtjj
|��qrWx6|D].}|jtjj
tjj||���q	WqW|S(s�Retrun a list of all files present on the system, excluding
                any directories listed in `exclude`.

            :param path: the starting path
            :param exclude: list of paths to exclude
            ttopdown(RtwalktTruetpathtjointstattS_ISLNKtlstattst_modetabspathtreadlinkt	Exceptiontappendtrealpath(	Rtexcludet	file_listtroottdirstfilestetdtname((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pytall_files_systems"%
-
#

!cSs_g}xR|D]J}tjj|�rJ|jdj|tj|���q
|j|�q
W|S(s4Format the unpackaged list as a string.
            s{} -> {}(RRtislinkRtformatR(Rtexpandedtf((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pyt
format_output7s
%tcmdcss!|]}tjj|�VqdS(N(RRR(t.0tx((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pys	<genexpr>Gss
t
unpackaged(
tNonettest_predicateRtsettpolicytmangle_package_pathtpackage_managert	all_filestadd_string_as_fileR
(
tselfRRR$tall_fsystemtall_frpmRR'tnot_packagedtnot_packaged_expanded((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pytsetups				%(t__name__t
__module__t__doc__R6(((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pyRs(tsos.pluginsRRRRR(((s:/usr/lib/python2.7/site-packages/sos/plugins/unpackaged.pyt<module>	s