%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/mac_assistive.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zddl
mZddlm
Zeje�ZdZd�Zed�Zd	�Zed
�Zd�Zd�Zd
�Zd�ZdS(u�
This module allows you to manage assistive access on macOS minions with 10.9+

.. versionadded:: 2016.3.0

.. code-block:: bash

    salt '*' assistive.install /usr/bin/osascript
i(tabsolute_importtunicode_literalstprint_functionN(tCommandExecutionError(tLooseVersionu	assistivecC@sOtjjj�stdfSttd�tjjjd�krKtdfSt	S(u
    Only work on Mac OS
    uMust be run on macOSu	osreleaseu10.9u"Must be run on macOS 10.9 or newer(
tsalttutilstplatformt	is_darwintFalset
_LooseVersiont
__grains__tstringutilstto_strt__virtualname__(((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyt__virtual__s

%
c	C@s;ttd�tjjjd�kr+tnt}ttd�tjjjd�kr\tnt}t|�}|rzdnd}dj	||||r�dnd|r�d	nd�}t
d
|ddd
t�}|ddkr7d}d|kr||d7}nd|kr||d7}ntdj	|���ntS(u�
    Install a bundle ID or command as being allowed to use
    assistive access.

    app_id
        The bundle ID or command to install for assistive access.

    enabled
        Sets enabled or disabled status. Default is ``True``.

    CLI Example:

    .. code-block:: bash

        salt '*' assistive.install /usr/bin/osascript
        salt '*' assistive.install com.smileonmymac.textexpander
    u	osreleaseu10.11u10.14u1u0u�sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','{0}',{1},{2},1,NULL{3}{4})"u,NULLuu,NULL,NULL,NULL,NULL,''ucmd.run_alltoutput_logleveludebugtpython_shelluretcodeiustderrustdoutuError installing app: {0}(R
RRRRR
tTrueR	t_client_typetformatt__salt__R(	tapp_idtenablet
ge_el_capitant	ge_mojavetclient_typet
enable_strtcmdtcalltcomment((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pytinstall's,11	cC@s,x%t�D]}||dkr
tSq
WtS(uh
    Check if a bundle ID or command is listed in assistive access.
    This will not check to see if it's enabled.

    app_id
        The bundle ID or command to check installed status.

    CLI Example:

    .. code-block:: bash

        salt '*' assistive.installed /usr/bin/osascript
        salt '*' assistive.installed com.smileonmymac.textexpander
    i(t_get_assistive_accessRR	(Rta((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyt	installedVscC@s�|rdnd}x�t�D]�}||dkrdj||�}td|dddt�}|d	dkr�d
}d|kr�||d7}nd|kr�||d7}ntd
j|���ntSqWtS(u�
    Enable or disable an existing assistive access application.

    app_id
        The bundle ID or command to set assistive access status.

    enabled
        Sets enabled or disabled status. Default is ``True``.

    CLI Example:

    .. code-block:: bash

        salt '*' assistive.enable /usr/bin/osascript
        salt '*' assistive.enable com.smileonmymac.textexpander enabled=False
    u1u0iupsqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "UPDATE access SET allowed='{0}' WHERE client='{1}'"ucmd.run_allRudebugRuretcodeuustderrustdoutuError enabling app: {0}(R RRR	RR(RtenabledRR!RRR((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyRls$	cC@s<x5t�D]*}||dkr
|ddkr
tSq
WtS(uN
    Check if a bundle ID or command is listed in assistive access and
    enabled.

    app_id
        The bundle ID or command to retrieve assistive access status.

    CLI Example:

    .. code-block:: bash

        salt '*' assistive.enabled /usr/bin/osascript
        salt '*' assistive.enabled com.smileonmymac.textexpander
    iiu1(R RR	(RR!((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyR#�s cC@s�dj|�}td|dddt�}|ddkr�d}d	|kr^||d	7}nd
|kr{||d
7}ntdj|���ntS(uF
    Remove a bundle ID or command as being allowed to use assistive access.

    app_id
        The bundle ID or command to remove from assistive access list.

    CLI Example:

    .. code-block:: bash

        salt '*' assistive.remove /usr/bin/osascript
        salt '*' assistive.remove com.smileonmymac.textexpander
    ucsqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "DELETE from access where client='{0}'"ucmd.run_allRudebugRuretcodeiuustderrustdoutuError removing app: {0}(RRR	RR(RRRR((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pytremove�s		cC@s|ddkrdSdS(uT
    Determine whether the given ID is a bundle ID or a
    a path to a command
    iu/u1u0((R((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyR�scC@s�d}td|dddt�}|ddkr�d}d	|krU||d	7}nd
|krr||d
7}ntdj|���n|d
}tjd|tj�S(
u�
    Get a list of all of the assistive access applications installed,
    returns as a ternary showing whether each app is enabled or not.
    uRsqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT * FROM access"ucmd.run_allRudebugRuretcodeiuustderrustdoutu
Error: {0}u@kTCCServiceAccessibility\|(.*)\|[0-9]{1}\|([0-9]{1})\|[0-9]{1}\|(RR	RRtretfindallt	MULTILINE(RRRtout((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyR �s	
(t__doc__t
__future__RRRR%tloggingtsalt.utils.platformRtsalt.utils.stringutilstsalt.exceptionsRtsalt.utils.versionsRR
t	getLoggert__name__tlogRRRRR"RR#R$RR (((s>/usr/lib/python2.7/site-packages/salt/modules/mac_assistive.pyt<module>
s"	/	+		"	

Zerion Mini Shell 1.0