%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/output/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/output/__init__.pyo

�
���^c@@s5dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZ
ddlZ
ddlZ
ddlZ
ddlmZeje�Zd�Zd�Zd�Zd�Zddd	�Zdd
�Zdd�Zdd�Zdd
�Zd�Z dS(ug
Used to manage the outputter system. This package is the modular system used
for managing outputters.
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcK@s�y2t||�||�}|dk	r1|j�SWn�tttfk
r�tjtj	��y2td|�||�}|dk	r�|j�SWq�tttfk
r�tj
ddt�td|�||�}|dk	r�|j�Sq�XnXdS(ux
    Safely get the string to print out, try the configured outputter, then
    fall back to nested and then to raw
    unesteduNested output failed: texc_infourawN(tget_printouttNonetrstriptKeyErrortAttributeErrort	TypeErrortlogtdebugt	tracebackt
format_excterrortTrue(tdatatouttoptstkwargstprintout((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pyttry_printout%scC@s/tjj||ddd�dj|�|�S(u7
    Get the progress bar from the given outputter
    u	rawmoduletmoduoutputu{0}.progress_iter(tsalttloadertraw_modtformat(RRtprogress((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytget_progress;scC@sMytjj|�|}Wntk
r;tjd�tSX|||�dS(u>
    Update the progress iterator for the given outputter
    u!Progress outputter not available.N(RRt
outputtersRRtwarningtFalse(RRt
progress_iterRtprogress_outputter((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytupdate_progressEs

cC@s&y|j�Wntk
r!nXdS(N(tstopt	ExceptionR(R!((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytprogress_endRs

c
K@s�|dkri}nt||||�}|jdd�}tjdj|��y�|r0t|d�s�tjj	j
|d�}t}n|}t}z~|}t
|tj�r�y|jd�}Wq�ttfk
r�q�Xn|r|jtjjj|��|jd�nWd|r+|j�nXdS|rLtjjj|�nWn.tk
r}}	|	jtjkr~|	�q~nXdS(u8
    Print the passed data using the desired output
    uoutput_fileu
data = {0}uwriteuauutf-8u
N(RRtgetRttraceRthasattrRtutilstfilestfopenRR t
isinstanceRt	text_typetencodetUnicodeDecodeErrortUnicodeEncodeErrortwritetstringutilstto_strtcloset	print_clitIOErrorterrnotEPIPE(
RRRRtdisplay_datatoutput_filenametofht	fh_openedtfdatatexc((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytdisplay_outputZs<		cK@s|dkri}nd|kr>|ddkr>|d}n|r�|jd�r�|jd�rp|d}q�|jdd�jd�ddkr�d}q�n|d	kr�d
}n!|dks�|dkr�d}n|jdt�r�d}n|j|�d
|krzd�}|jdt�r3t|d
<q�|jdt�s`|�s`tjjj	�rmt|d
<q�t|d
<nP|jdt�r�t|d
<n1|jdt�s�tjjj	�r�t|d
<ntj
j|�}||kr|dkr
tj
dj|��n|dS||S(u#
    Return a printer function
    uoutputu	highstateustaticufunuu.iustateutextutxtunesteduprogressucolorcS@sDytjj�}Wn ttjfk
r5d}nXtj|�S(u>
            Check if sys.stdout is a pipe or not
            i����(tsyststdouttfilenoR	tiotUnsupportedOperationtostisatty(RC((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytis_pipe�s

uforce_coloruno_colorugrainsu4Invalid outputter {0} specified, fall back to nestedN(RR'tsplitR tupdateRRR*tplatformt
is_windowsRRRRR(RRRRHR((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pyR�sB	

%			
	

-


$
cK@st||||�S(uC
    Return the formatted outputter string for the passed data
    (R(RRRR((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pyt
out_format�scK@s4t||||�}tjd�}|jd|�S(uT
    Return the formatted outputter string, removing the ANSI escape sequences.
    u
\x1b[^m]*mu(Rtretcompiletsub(RRRRt
raw_outputtansi_escape((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pyt
string_format�scK@s1t||||�}|jdd�jdd�S(u.
    Return the formatted string as HTML.
    u u&nbsp;u
u<br />(RStreplace(RRRRtansi_escaped_string((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pythtml_format�scC@s^t|tj�rVy|jdd�SWqZtk
rR|jtd�td��SXn|SdS(u{
    Replace ESC (ASCII 27/Oct 33) to prevent unsafe strings
    from writing their own terminal manipulation commands
    uu?N(R-Rtstring_typesRTR0tstr(ttxt((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pytstrip_esc_sequence�s
 (!t__doc__t
__future__RRRR8tloggingRDRFRNRAR
tsalt.loaderRtsalt.utils.filestsalt.utils.platformtsalt.utils.stringutilstsalt.extRt	getLoggert__name__RRRR#R&RR@RRMRSRVRZ(((s8/usr/lib/python2.7/site-packages/salt/output/__init__.pyt<module>s0			
	
	-B	

Zerion Mini Shell 1.0