%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s{dZddlmZmZmZddlZddlmZde	d�Z
de	d�Zd�Zd�Z
d	�ZdS(
uE
Helper functions for transport components to handle message framing
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@s<i}|dkri}n||d<||d<tj|�S(u8
    Frame the given message with our wire protocol
    uheadubodyN(tNonetmsgpacktdumps(tbodytheadertraw_bodyt
framed_msg((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pyt	frame_msgs	

cC@s\i}|dkri}n||d<||d<tjrEtj|�Stj|dt�SdS(u�
    Frame the given message with our wire protocol for IPC

    For IPC, we don't need to be backwards compatible, so
    use the more efficient "use_bin_type=True" on Python 3.
    uheadubodytuse_bin_typeN(RRtPY2RRtTrue(RRR	R
((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pyt
frame_msg_ipcs	

	
cC@s�g}x�|D]�}t|t�r1t|�}nTt|t�rOt|�}n6t|t�r�y|j�}Wq�tk
r�q�Xn|j|�q
W|S(uI
    Convert enbedded bytes to strings if possible.
    List helper.
    (	t
isinstancetdictt_decode_embedded_dicttlistt_decode_embedded_listtbytestdecodetUnicodeErrortappend(tsrctoutputtelem((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pyR+s

cC@s�i}x�tj|�D]�\}}t|t�r@t|�}nTt|t�r^t|�}n6t|t�r�y|j�}Wq�t	k
r�q�Xnt|t�r�y|j�}Wq�t	k
r�q�Xn|||<qW|S(uI
    Convert enbedded bytes to strings if possible.
    Dict helper.
    (
Rt	iteritemsRRRRRRRR(RRtkeytval((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pyR?s$

cC@s|tjs
|St|t�r&t|�St|t�r?t|�St|t�rty|j�SWqxt	k
rp|SXn|SdS(u�
    Convert enbedded bytes to strings if possible.
    This is necessary because Python 3 makes a distinction
    between these types.

    This wouldn't be needed if we used "use_bin_type=True" when encoding
    and "encoding='utf-8'" when decoding. Unfortunately, this would break
    backwards compatibility due to a change in wire protocol, so this less
    than ideal solution is used instead.
    N(
RtPY3RRRRRRRR(R((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pytdecode_embedded_strsXs	


(t__doc__t
__future__RRRRtsalt.extRRtFalseRRRRR (((s8/usr/lib/python2.7/site-packages/salt/transport/frame.pyt<module>s
		

Zerion Mini Shell 1.0