Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/pipes.cpython-37.opt-2.pyc

B

YI~d�"�@slddlZddlZddlZddlmZdgZdZdZdZdZ	dZ
d	Zeeee	e
egZGd
d�d�Z
dd�ZdS)
�N)�quote�TemplateZffz-fzf-z--z.-z-.c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)rcCsd|_|��dS)Nr)�	debugging�reset)�self�r�*/opt/alt/python37/lib64/python3.7/pipes.py�__init__UszTemplate.__init__cCsd|jfS)Nz<Template instance, steps=%r>)�steps)rrrr�__repr__ZszTemplate.__repr__cCs
g|_dS)N)r
)rrrrr^szTemplate.resetcCs"t�}|jdd�|_|j|_|S)N)rr
r)r�trrr�clonebszTemplate.clonecCs
||_dS)N)r)r�flagrrr�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)N�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�fz\$IN\bz#Template.append: missing $IN in cmdz\$OUT\bz$Template.append: missing $OUT in cmd)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append)r�cmd�kindrrrrnszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�dS)
Nrz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErz\$IN\bz$Template.prepend: missing $IN in cmdz\$OUT\bz%Template.prepend: missing $OUT in cmd)
rrrrrr
rrr�insert)rrrrrr�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)N�r�wz,Template.open: rw must be 'r' or 'w', not %r)�open_r�open_wr)r�file�rwrrr�open�s

z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)Nr!rrz)Template.open_r: pipeline ends width SINKr)r
r'rr�makepipeline�os�popen)rr%rrrrr#�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr"rrz,Template.open_w: pipeline begins with SOURCEr)r
r'rrr(r)r*)rr%rrrrr$�s
zTemplate.open_wcCst�|�||��S)N)r)�systemr()r�infile�outfilerrr�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r(r
r�print)rr,r-rrrrr(�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__r	rrr
rrr r'r#r$r.r(rrrrrRs

cCs�g}x"|D]\}}|�d||dg�q
W|s>|�ddddg�|ddd�\}}|ddkrv|sv|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}x�tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�Wx�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qXW|dd}xd|dd�D]T}|dd�\}}|ddk�rbd|k�rTd|d}|d|}n|d|}�qW|�r�d}x|D]}|dt|�}�q�Wdt|d�d}|d|d|}|S)Nr�catz--rr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	rr�range�len�tempfileZmkstempr)�closer)r,r
r-�listrrZgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr%Ztrapcmdrrrr(�s`

 


r()rr)r;Zshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr(rrrr�<module><sc

Hacked By AnonymousFox1.0, Coded By AnonymousFox