def install(app_id, enable=True):
    '''
    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
    '''
    client_type = _client_type(app_id)
    enable_str = '1' if enable else '0'
    cmd = 'sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" ' \
          '"INSERT or REPLACE INTO access VALUES(\'kTCCServiceAccessibility\',\'{0}\',{1},{2},1,NULL)"'.\
        format(app_id, client_type, enable_str)

    call = __salt__['cmd.run_all'](
        cmd,
        output_loglevel='debug',
        python_shell=False
    )
    if call['retcode'] != 0:
        comment = ''
        if 'stderr' in call:
            comment += call['stderr']
        if 'stdout' in call:
            comment += call['stdout']

        raise CommandExecutionError('Error installing app: {0}'.format(comment))

    return True
dataset/ETHPy150Open saltstack/salt/salt/modules/mac_assistive.py/install/original