$79 GRAYBYTE WORDPRESS FILE MANAGER $92

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.121
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python35/lib64/python3.5/__pycache__/

HOME
Current File : /opt/alt/python35/lib64/python3.5/__pycache__//pipes.cpython-35.pyc


��Yf�"�@s�dZddlZddlZddlZddlmZdgZdZdZdZ	dZ
d	Zd
Zeee	e
eegZ
Gdd�d�Zdd
�ZdS)a�Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
�N)�quote�TemplateZffz-fzf-z--z.-z-.c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz'Class representing a pipeline template.cCsd|_|j�dS)z-Template() returns a fresh pipeline template.rN)�	debugging�reset)�self�r�*/opt/alt/python35/lib64/python3.5/pipes.py�__init__Us	zTemplate.__init__cCsd|jfS)z t.__repr__() implements repr(t).z<Template instance, steps=%r>)�steps)rrrr�__repr__ZszTemplate.__repr__cCs
g|_dS)z<t.reset() restores a pipeline template to its initial state.N)r
)rrrrr^szTemplate.resetcCs/t�}|jdd�|_|j|_|S)zbt.clone() returns a new pipeline template with identical
        initial state as the current one.N)rr
r)r�trrr�clonebs	zTemplate.clonecCs
||_dS)z(t.debug(flag) turns debugging on or off.N)r)rZflagrrr�debugjszTemplate.debugcCs�t|�td�k	r$td��|tkrCtd|f��|tkr[td��|jr�|jddtkr�td��|ddkr�tjd	|�r�td
��|ddkr�tjd|�r�td��|jj	||f�d
S)z/t.append(cmd, kind) adds a new step at the end.�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 cmdN���)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append)r�cmd�kindrrrrns ##zTemplate.appendcCst|�td�k	r$td��|tkrCtd|f��|tkr[td��|jr�|jddtkr�td��|ddkr�tjd	|�r�td
��|ddkr�tjd|�r�td��|jj	d||f�d
S)z2t.prepend(cmd, kind) adds a new step at the front.rz&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 cmdN)
rrrrrr
rrr�insert)rrrrrr�prepend~s ##zTemplate.prependcCsI|dkr|j|�S|dkr2|j|�Std|f��dS)z~t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline.�r�wz,Template.open: rw must be 'r' or 'w', not %rN)�open_r�open_wr)r�fileZrwrrr�open�s

z
Template.opencCs[|jst|d�S|jddtkr9td��|j|d�}tj|d�S)zit.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively.r rz)Template.open_r: pipeline ends width SINKrr)r
r%rr�makepipeline�os�popen)rr$rrrrr"�s	
zTemplate.open_rcCs[|jst|d�S|jddtkr9td��|jd|�}tj|d�S)Nr!rrz,Template.open_w: pipeline begins with SOURCEr)r
r%rrr&r'r()rr$rrrrr#�s	
zTemplate.open_wcCstj|j||��S)N)r'�systemr&)r�infile�outfilerrr�copy�sz
Template.copycCs6t||j|�}|jr2t|�d|}|S)Nzset -x; )r&r
r�print)rr*r+rrrrr&�s
	

zTemplate.makepipelineN)�__name__�
__module__�__qualname__�__doc__r	rrr
rrrr%r"r#r,r&rrrrrRs

cCstg}x-|D]%\}}|jd||dg�q
W|sU|jddddg�|ddd�\}}|ddkr�|r�|jdddddg�||dd<|ddd�\}}|ddkr�|r�|jddddg�||dd<g}x�tdt|��D]�}||dd}||d}	|ddksj|	ddkr$tj�\}
}tj|
�|j|�|||dd<||d<q$Wx�|D]�}|\}
}}}|ddkr�d	t|�d
|}|ddkr'dt|
�d
|}|ddkrQ|
rQ|d
t|
�}|ddkr{|r{|dt|�}||d<q�W|dd}xw|dd�D]e}|dd�\}}|ddkr�d|kr�d|d}|d|}q�|d|}q�W|rpd}x"|D]}|dt|�}q$Wdt|d�d}|d|d|}|S)Nr�catz--rr�r�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15rrrr)	rr�range�len�tempfileZmkstempr'�closer)r*r
r+�listrrZgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr$Ztrapcmdrrrr&�s` 

"

r&)r1rr'r:Zshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr&rrrr�<module>9s	c

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
12 Aug 2024 8.41 AM
root / linksafe
0755
__future__.cpython-35.opt-1.pyc
4.213 KB
31 May 2024 1.51 PM
root / linksafe
0644
__future__.cpython-35.opt-2.pyc
2.281 KB
31 May 2024 1.51 PM
root / linksafe
0644
__future__.cpython-35.pyc
4.213 KB
31 May 2024 1.51 PM
root / linksafe
0644
__phello__.foo.cpython-35.opt-1.pyc
0.131 KB
31 May 2024 1.51 PM
root / linksafe
0644
__phello__.foo.cpython-35.opt-2.pyc
0.131 KB
31 May 2024 1.51 PM
root / linksafe
0644
__phello__.foo.cpython-35.pyc
0.131 KB
31 May 2024 1.51 PM
root / linksafe
0644
_bootlocale.cpython-35.opt-1.pyc
0.989 KB
31 May 2024 1.51 PM
root / linksafe
0644
_bootlocale.cpython-35.opt-2.pyc
0.768 KB
31 May 2024 1.51 PM
root / linksafe
0644
_bootlocale.cpython-35.pyc
1.02 KB
31 May 2024 1.51 PM
root / linksafe
0644
_collections_abc.cpython-35.opt-1.pyc
29.117 KB
31 May 2024 1.51 PM
root / linksafe
0644
_collections_abc.cpython-35.opt-2.pyc
24.558 KB
31 May 2024 1.51 PM
root / linksafe
0644
_collections_abc.cpython-35.pyc
29.117 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compat_pickle.cpython-35.opt-1.pyc
6.487 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compat_pickle.cpython-35.opt-2.pyc
6.487 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compat_pickle.cpython-35.pyc
6.56 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compression.cpython-35.opt-1.pyc
4.345 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compression.cpython-35.opt-2.pyc
4.128 KB
31 May 2024 1.51 PM
root / linksafe
0644
_compression.cpython-35.pyc
4.345 KB
31 May 2024 1.51 PM
root / linksafe
0644
_dummy_thread.cpython-35.opt-1.pyc
4.942 KB
31 May 2024 1.51 PM
root / linksafe
0644
_dummy_thread.cpython-35.opt-2.pyc
2.782 KB
31 May 2024 1.51 PM
root / linksafe
0644
_dummy_thread.cpython-35.pyc
4.942 KB
31 May 2024 1.51 PM
root / linksafe
0644
_markupbase.cpython-35.opt-1.pyc
8.488 KB
31 May 2024 1.51 PM
root / linksafe
0644
_markupbase.cpython-35.opt-2.pyc
8.113 KB
31 May 2024 1.51 PM
root / linksafe
0644
_markupbase.cpython-35.pyc
8.671 KB
31 May 2024 1.51 PM
root / linksafe
0644
_osx_support.cpython-35.opt-1.pyc
10.242 KB
31 May 2024 1.51 PM
root / linksafe
0644
_osx_support.cpython-35.opt-2.pyc
7.849 KB
31 May 2024 1.51 PM
root / linksafe
0644
_osx_support.cpython-35.pyc
10.242 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pydecimal.cpython-35.opt-1.pyc
168.067 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pydecimal.cpython-35.opt-2.pyc
88.927 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pydecimal.cpython-35.pyc
168.067 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pyio.cpython-35.opt-1.pyc
74.202 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pyio.cpython-35.opt-2.pyc
52.301 KB
31 May 2024 1.51 PM
root / linksafe
0644
_pyio.cpython-35.pyc
74.228 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sitebuiltins.cpython-35.opt-1.pyc
3.583 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sitebuiltins.cpython-35.opt-2.pyc
3.065 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sitebuiltins.cpython-35.pyc
3.583 KB
31 May 2024 1.51 PM
root / linksafe
0644
_strptime.cpython-35.opt-1.pyc
15.423 KB
31 May 2024 1.51 PM
root / linksafe
0644
_strptime.cpython-35.opt-2.pyc
11.979 KB
31 May 2024 1.51 PM
root / linksafe
0644
_strptime.cpython-35.pyc
15.423 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sysconfigdata.cpython-35.opt-1.pyc
23.113 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sysconfigdata.cpython-35.opt-2.pyc
23.113 KB
31 May 2024 1.51 PM
root / linksafe
0644
_sysconfigdata.cpython-35.pyc
23.113 KB
31 May 2024 1.51 PM
root / linksafe
0644
_threading_local.cpython-35.opt-1.pyc
6.737 KB
31 May 2024 1.51 PM
root / linksafe
0644
_threading_local.cpython-35.opt-2.pyc
3.305 KB
31 May 2024 1.51 PM
root / linksafe
0644
_threading_local.cpython-35.pyc
6.737 KB
31 May 2024 1.51 PM
root / linksafe
0644
_weakrefset.cpython-35.opt-1.pyc
8.224 KB
31 May 2024 1.51 PM
root / linksafe
0644
_weakrefset.cpython-35.opt-2.pyc
8.224 KB
31 May 2024 1.51 PM
root / linksafe
0644
_weakrefset.cpython-35.pyc
8.224 KB
31 May 2024 1.51 PM
root / linksafe
0644
abc.cpython-35.opt-1.pyc
7.632 KB
31 May 2024 1.51 PM
root / linksafe
0644
abc.cpython-35.opt-2.pyc
4.335 KB
31 May 2024 1.51 PM
root / linksafe
0644
abc.cpython-35.pyc
7.681 KB
31 May 2024 1.51 PM
root / linksafe
0644
aifc.cpython-35.opt-1.pyc
27.153 KB
31 May 2024 1.51 PM
root / linksafe
0644
aifc.cpython-35.opt-2.pyc
22.06 KB
31 May 2024 1.51 PM
root / linksafe
0644
aifc.cpython-35.pyc
27.153 KB
31 May 2024 1.51 PM
root / linksafe
0644
antigravity.cpython-35.opt-1.pyc
0.828 KB
31 May 2024 1.51 PM
root / linksafe
0644
antigravity.cpython-35.opt-2.pyc
0.688 KB
31 May 2024 1.51 PM
root / linksafe
0644
antigravity.cpython-35.pyc
0.828 KB
31 May 2024 1.51 PM
root / linksafe
0644
argparse.cpython-35.opt-1.pyc
63.842 KB
31 May 2024 1.51 PM
root / linksafe
0644
argparse.cpython-35.opt-2.pyc
54.792 KB
31 May 2024 1.51 PM
root / linksafe
0644
argparse.cpython-35.pyc
63.997 KB
31 May 2024 1.51 PM
root / linksafe
0644
ast.cpython-35.opt-1.pyc
12.007 KB
31 May 2024 1.51 PM
root / linksafe
0644
ast.cpython-35.opt-2.pyc
6.547 KB
31 May 2024 1.51 PM
root / linksafe
0644
ast.cpython-35.pyc
12.007 KB
31 May 2024 1.51 PM
root / linksafe
0644
asynchat.cpython-35.opt-1.pyc
8.281 KB
31 May 2024 1.51 PM
root / linksafe
0644
asynchat.cpython-35.opt-2.pyc
6.934 KB
31 May 2024 1.51 PM
root / linksafe
0644
asynchat.cpython-35.pyc
8.281 KB
31 May 2024 1.51 PM
root / linksafe
0644
asyncore.cpython-35.opt-1.pyc
16.771 KB
31 May 2024 1.51 PM
root / linksafe
0644
asyncore.cpython-35.opt-2.pyc
15.594 KB
31 May 2024 1.51 PM
root / linksafe
0644
asyncore.cpython-35.pyc
16.771 KB
31 May 2024 1.51 PM
root / linksafe
0644
base64.cpython-35.opt-1.pyc
17.813 KB
31 May 2024 1.51 PM
root / linksafe
0644
base64.cpython-35.opt-2.pyc
12.344 KB
31 May 2024 1.51 PM
root / linksafe
0644
base64.cpython-35.pyc
18.006 KB
31 May 2024 1.51 PM
root / linksafe
0644
bdb.cpython-35.opt-1.pyc
18.124 KB
31 May 2024 1.51 PM
root / linksafe
0644
bdb.cpython-35.opt-2.pyc
16.431 KB
31 May 2024 1.51 PM
root / linksafe
0644
bdb.cpython-35.pyc
18.124 KB
31 May 2024 1.51 PM
root / linksafe
0644
binhex.cpython-35.opt-1.pyc
13.112 KB
31 May 2024 1.51 PM
root / linksafe
0644
binhex.cpython-35.opt-2.pyc
12.582 KB
31 May 2024 1.51 PM
root / linksafe
0644
binhex.cpython-35.pyc
13.112 KB
31 May 2024 1.51 PM
root / linksafe
0644
bisect.cpython-35.opt-1.pyc
2.768 KB
31 May 2024 1.51 PM
root / linksafe
0644
bisect.cpython-35.opt-2.pyc
1.5 KB
31 May 2024 1.51 PM
root / linksafe
0644
bisect.cpython-35.pyc
2.768 KB
31 May 2024 1.51 PM
root / linksafe
0644
bz2.cpython-35.opt-1.pyc
11.512 KB
31 May 2024 1.51 PM
root / linksafe
0644
bz2.cpython-35.opt-2.pyc
6.595 KB
31 May 2024 1.51 PM
root / linksafe
0644
bz2.cpython-35.pyc
11.512 KB
31 May 2024 1.51 PM
root / linksafe
0644
cProfile.cpython-35.opt-1.pyc
4.498 KB
31 May 2024 1.51 PM
root / linksafe
0644
cProfile.cpython-35.opt-2.pyc
4.035 KB
31 May 2024 1.51 PM
root / linksafe
0644
cProfile.cpython-35.pyc
4.498 KB
31 May 2024 1.51 PM
root / linksafe
0644
calendar.cpython-35.opt-1.pyc
27.001 KB
31 May 2024 1.51 PM
root / linksafe
0644
calendar.cpython-35.opt-2.pyc
22.568 KB
31 May 2024 1.51 PM
root / linksafe
0644
calendar.cpython-35.pyc
27.001 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgi.cpython-35.opt-1.pyc
29.165 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgi.cpython-35.opt-2.pyc
20.472 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgi.cpython-35.pyc
29.165 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgitb.cpython-35.opt-1.pyc
10.745 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgitb.cpython-35.opt-2.pyc
9.18 KB
31 May 2024 1.51 PM
root / linksafe
0644
cgitb.cpython-35.pyc
10.745 KB
31 May 2024 1.51 PM
root / linksafe
0644
chunk.cpython-35.opt-1.pyc
5.097 KB
31 May 2024 1.51 PM
root / linksafe
0644
chunk.cpython-35.opt-2.pyc
2.999 KB
31 May 2024 1.51 PM
root / linksafe
0644
chunk.cpython-35.pyc
5.097 KB
31 May 2024 1.51 PM
root / linksafe
0644
cmd.cpython-35.opt-1.pyc
13.094 KB
31 May 2024 1.51 PM
root / linksafe
0644
cmd.cpython-35.opt-2.pyc
7.778 KB
31 May 2024 1.51 PM
root / linksafe
0644
cmd.cpython-35.pyc
13.094 KB
31 May 2024 1.51 PM
root / linksafe
0644
code.cpython-35.opt-1.pyc
9.596 KB
31 May 2024 1.51 PM
root / linksafe
0644
code.cpython-35.opt-2.pyc
4.721 KB
31 May 2024 1.51 PM
root / linksafe
0644
code.cpython-35.pyc
9.596 KB
31 May 2024 1.51 PM
root / linksafe
0644
codecs.cpython-35.opt-1.pyc
34.476 KB
31 May 2024 1.51 PM
root / linksafe
0644
codecs.cpython-35.opt-2.pyc
18.981 KB
31 May 2024 1.51 PM
root / linksafe
0644
codecs.cpython-35.pyc
34.476 KB
31 May 2024 1.51 PM
root / linksafe
0644
codeop.cpython-35.opt-1.pyc
6.303 KB