%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_xattr.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
eje�Z
dZidd6Zd�Zd	�Zd
�Zd�Zd�Zd
�ZdS(u�
This module allows you to manage extended attributes on files or directories

.. code-block:: bash

    salt '*' xattr.list /path/to/file
i(tabsolute_importtunicode_literalstprint_functionN(tCommandExecutionErroruxattrulistulist_cC@stddkrtStS(u
    Only work on Mac OS
    uosuMacOSuDarwin(uMacOSuDarwin(t
__grains__t__virtualname__tFalse(((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyt__virtual__sc	K@stjjj|�}|jdt�}|rCtjjj|�nd|g}ytjjj|�}WnRt	k
r�}d|j
kr�t	dj|���nt	dj|j
���nX|s�iS|jd�}i}x+|D]#}t
||i|d6�||<q�W|S(u
    List all of the extended attributes on the given file/directory

    :param str path: The file(s) to get attributes from

    :param bool hex: Return the values with forced hexadecimal values

    :return: A dictionary containing extended attributes and values for the
        given file
    :rtype: dict

    :raises: CommandExecutionError on file not found or any other unknown error

    CLI Example:

    .. code-block:: bash

        salt '*' xattr.list /path/to/file
        salt '*' xattr.list /path/to/file hex=True
    uhexuxattruNo such fileuFile not found: {0}uUnknown Error: {0}u
(tsalttutilstargstclean_kwargstpopRtinvalid_kwargst	mac_utilstexecute_return_resultRtstrerrortformattsplittread(	tpathtkwargsthex_tcmdtrettexct	attrs_idstattrstid_((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pytlist_$s$
!cK@stjjj|�}|jdt�}|rCtjjj|�nddg}|re|jd�n|j||g�ytjj	j
|�}Wnytk
r}d|jkr�tdj
|���nd|jkr�tdj
|���ntd	j
|j���nX|S(
uV
    Read the given attributes on the given file/directory

    :param str path: The file to get attributes from

    :param str attribute: The attribute to read

    :param bool hex: Return the values with forced hexadecimal values

    :return: A string containing the value of the named attribute
    :rtype: str

    :raises: CommandExecutionError on file not found, attribute not found, and
        any other unknown error

    CLI Example:

    .. code-block:: bash

        salt '*' xattr.read /path/to/file com.test.attr
        salt '*' xattr.read /path/to/file com.test.attr hex=True
    uhexuxattru-pu-xuNo such fileuFile not found: {0}u
No such xattruAttribute not found: {0}uUnknown Error: {0}(RR	R
RRRR
tappendtextendRRRRR(Rt	attributeRRRRR((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyRRs"cK@stjjj|�}|jdt�}|rCtjjj|�nddg}|re|jd�n|j|||g�ytjj	j
|�WnRtk
r�}d|jkr�tdj
|���ntdj
|j���nXt||i|d6�|kS(u^
    Causes the given attribute name to be assigned the given value

    :param str path: The file(s) to get attributes from

    :param str attribute: The attribute name to be written to the file/directory

    :param str value: The value to assign to the given attribute

    :param bool hex: Set the values with forced hexadecimal values

    :return: True if successful, otherwise False
    :rtype: bool

    :raises: CommandExecutionError on file not found or any other unknown error

    CLI Example:

    .. code-block:: bash

        salt '*' xattr.write /path/to/file "com.test.attr" "value"

    uhexuxattru-wu-xuNo such fileuFile not found: {0}uUnknown Error: {0}(RR	R
RRRR
RRRtexecute_return_successRRRR(RR tvalueRRRR((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pytwritescC@s�dj||�}ytjjj|�Wnytk
r�}d|jkrbtdj|���nd|jkr�tdj|���ntdj|j���nX|t|�kS(u�
    Removes the given attribute from the file

    :param str path: The file(s) to get attributes from

    :param str attribute: The attribute name to be deleted from the
        file/directory

    :return: True if successful, otherwise False
    :rtype: bool

    :raises: CommandExecutionError on file not found, attribute not found, and
        any other unknown error

    CLI Example:

    .. code-block:: bash

        salt '*' xattr.delete /path/to/file "com.test.attr"
    uxattr -d "{0}" "{1}"uNo such fileuFile not found: {0}u
No such xattruAttribute not found: {0}uUnknown Error: {0}(RRR	RR!RRR(RR RR((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pytdelete�scC@s�dj|�}ytjjj|�WnRtk
rz}d|jkr_tdj|���ntdj|j���nXt|�ikS(ul
    Causes the all attributes on the file/directory to be removed

    :param str path: The file(s) to get attributes from

    :return: True if successful, otherwise False

    :raises: CommandExecutionError on file not found or any other unknown error

    CLI Example:

    .. code-block:: bash

        salt '*' xattr.delete /path/to/file "com.test.attr"
    uxattr -c "{0}"uNo such fileuFile not found: {0}uUnknown Error: {0}(RRR	RR!RRR(RRR((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pytclear�s(t__doc__t
__future__RRRtloggingtsalt.utils.argsRtsalt.utils.mac_utilstsalt.exceptionsRt	getLoggert__name__tlogRt__func_alias__RRRR#R$R%(((s:/usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyt<module>s
			.	-	,	"

Zerion Mini Shell 1.0