%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m Z e j e � Z d Z i d d 6Z d � Z d � Z d � Z d � Z d � Z d � Z d S( u� This module allows you to manage extended attributes on files or directories .. code-block:: bash salt '*' xattr.list /path/to/file i ( t absolute_importt unicode_literalst print_functionN( t CommandExecutionErroru xattru listu list_c C@ s t d d k r t St S( u Only work on Mac OS u osu MacOSu Darwin( u MacOSu Darwin( t __grains__t __virtualname__t False( ( ( s: /usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyt __virtual__ s c K@ s t j j j | � } | j d t � } | rC t j j j | � n d | g } y t j j j | � } WnR t k r� } d | j k r� t d j | � � � n t d j | j � � � n X| s� i S| j d � } i } x+ | D]# } t | | i | d 6� | | <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 u hexu xattru No such fileu File not found: {0}u Unknown Error: {0}u ( t saltt utilst argst clean_kwargst popR t invalid_kwargst mac_utilst execute_return_resultR t strerrort formatt splitt read( t patht kwargst hex_t cmdt rett exct attrs_idst attrst id_( ( s: /usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyt list_$ s$ !c K@ s t j j j | � } | j d t � } | rC t j j j | � n d d g } | re | j d � n | j | | g � y t j j j | � } Wny t k r} d | j k r� t d j | � � � n d | j k r� t d j | � � � n t d j | j � � � n X| 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 u hexu xattru -pu -xu No such fileu File not found: {0}u No such xattru Attribute not found: {0}u Unknown Error: {0}( R R R R R R R t appendt extendR R R R R ( R t attributeR R R R R ( ( s: /usr/lib/python2.7/site-packages/salt/modules/mac_xattr.pyR R s"