%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZddlmZmZeje�ZyddljjZWn�ek
rDyddljjZWqEek
r@yddljZWqAek
r<yddljZWq=ek
r8dZq=XqAXqEXnXejjdkZ e rrddl!Z!e!Z"nddl"Z"edk	r�e#ed�s�d	efd
��YZ$e$e_$q�nddd
�Z%ddd�Z&d�Z'ddd�Z(dd�Z)y+e rddl*Z*nddl+j,j*Z*Wne-k
rDdZ*nXde*j.fd��YZ/de*j0e/fd��YZ1e*r�e/e*_.ejjdkr�e1e*_0q�ndS(u
Salt compatibility code
i(tabsolute_importtunicode_literalstprint_functionN(t
SaltException(tbinary_typetstring_typest	text_typet
integer_types(t	cStringIOtStringIOiu
ParseErrort
ParseErrorcB@seZdZRS(uN
            older versions of ElementTree do not have ParseError
            (t__name__t
__module__t__doc__(((s0/usr/lib/python2.7/site-packages/salt/_compat.pyR
4sulatin-1ustrictcC@s#t|t�r|j||�S|S(uw
    If ``s`` is an instance of ``binary_type``, return
    ``s.decode(encoding, errors)``, otherwise return ``s``
    (t
isinstanceRtdecode(tstencodingterrors((s0/usr/lib/python2.7/site-packages/salt/_compat.pyttext_<scC@s#t|t�r|j||�S|S(uu
    If ``s`` is an instance of ``text_type``, return
    ``s.encode(encoding, errors)``, otherwise return ``s``
    (RRtencode(RRR((s0/usr/lib/python2.7/site-packages/salt/_compat.pytbytes_DscC@s;t|t�r!|jd�}ntr7t|dd�S|S(u
    Python 3: If ``s`` is an instance of ``text_type``, return
    ``s.encode('ascii')``, otherwise return ``str(s, 'ascii', 'strict')``

    Python 2: If ``s`` is an instance of ``text_type``, return
    ``s.encode('ascii')``, otherwise return ``str(s)``
    uasciiustrict(RRRtPY3tstr(R((s0/usr/lib/python2.7/site-packages/salt/_compat.pyt
ascii_native_LscC@satr0t|t�r|nt|||�}n-t|t�rQ|j||�n	t|�}|S(u�
    Python 3: If ``s`` is an instance of ``text_type``, return ``s``, otherwise
    return ``str(s, encoding, errors)``

    Python 2: If ``s`` is an instance of ``text_type``, return
    ``s.encode(encoding, errors)``, otherwise return ``str(s)``
    (RRRRR(RRRtout((s0/usr/lib/python2.7/site-packages/salt/_compat.pytnative_Zs*-cC@s9ytt|��SWnttfk
r4t|�SXdS(u@
    Pass data through to stringIO module and return result
    N(RtbytestUnicodeEncodeErrort	TypeErrorR	(tdata((s0/usr/lib/python2.7/site-packages/salt/_compat.pyt	string_iojstIPv6AddressScopedcB@s8eZdZd�Zd�Zed��Zd�ZRS(uQ
    Represent and manipulate single IPv6 Addresses.
    Scope-aware version
    cC@s�t|d�sd�|_nt|t�r�d|kr�|jd�}t|�dkrrtdj|���n|\}|_n	d
|_t
jjdkr�t
jj||�t
jj||�nd|_t
j|_t|t�r|j|�||_n�|j|�rB|j|d�ttj|�d�|_nEt|�}d|krut
jd	j|���n|j|�|_d
S(u-
        Instantiate a new IPv6 address object. Scope is moved to an attribute 'scope'.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') == IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) == IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        :param address:
        u_is_packed_binarycS@s
t|t�S(N(RR(tp((s0/usr/lib/python2.7/site-packages/salt/_compat.pyt<lambda>�su%iuInvalid IPv6 address: "{}"iiu/uUnexpected '/' in {}N(thasattrt_is_packed_binaryRRtsplittlenRtformatt_IPv6AddressScoped__scopetNonetsystversion_infotmajort	ipaddresst_BaseAddresst__init__t_BaseV6t_versiont
IPV6LENGTHt_max_prefixlenRt_check_int_addresst_ipt_check_packed_addresstinttbinasciithexlifyRtAddressValueErrort_ip_int_from_string(tselftaddresstbuff((s0/usr/lib/python2.7/site-packages/salt/_compat.pyR/�s.		
cC@spt}t|t�rlt|�dkrld|krly"tttj|�d��}Wqltk
rhqlXn|S(u\
        Check if data is hexadecimal packed

        :param data:
        :return:
        it:(	tFalseRRR&tboolR7R8R9t
ValueError(R<Rtpacked((s0/usr/lib/python2.7/site-packages/salt/_compat.pyR$�s-"
cC@s|jS(uA
        Return scope of IPv6 address.

        :return:
        (R((R<((s0/usr/lib/python2.7/site-packages/salt/_compat.pytscope�scC@s6t|j|j�|jdk	r.d|jnd�S(Nu%u(Rt_string_from_ip_intR5RDR)(R<((s0/usr/lib/python2.7/site-packages/salt/_compat.pyt__str__�s(RRR
R/R$tpropertyRDRF(((s0/usr/lib/python2.7/site-packages/salt/_compat.pyR }s
	5		tIPv6InterfaceScopedcB@seZdZd�ZRS(u
    Update
    cC@s�t|ttf�rJtj||�tj|j�|_|j	|_
dStj|�}tj||d�tj|dt�|_|jj
|_
|jj
|_
|jj|_dS(Nitstrict(RRR7R R/R-tIPv6NetworkR5tnetworkR3t
_prefixlent_split_optional_netmaskR@tnetmaskthostmask(R<R=taddr((s0/usr/lib/python2.7/site-packages/salt/_compat.pyR/�s(RRR
R/(((s0/usr/lib/python2.7/site-packages/salt/_compat.pyRH�si(2R
t
__future__RRRR*tloggingR8tsalt.exceptionsRtsalt.ext.sixRRRRtsalt.ext.six.movesRR	t	getLoggerRtlogtxml.etree.cElementTreetetreetcElementTreetElementTreet	Exceptiontxml.etree.ElementTreetelementtree.cElementTreetelementtree.ElementTreeR)R+R,Rtbuiltinst
exceptionsR#R
RRRRRR-tsalt.ext.ipaddresstexttImportErrortIPv6AddressR t
IPv6InterfaceRH(((s0/usr/lib/python2.7/site-packages/salt/_compat.pyt<module>s^"



		


X	

Zerion Mini Shell 1.0