tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
M\¬Qc@sVdZddlZddlZddlZejdeddƒdddgZyejd    ƒZWne    e
fk
rd
ZnXgZ d „Z d dd „ƒYZ de fd„ƒYZejd dksÜejdkr[ [ddd„Zddd„Zddd„Zn@ddd„Zddd„Zddd„Zejd dgƒdS(snSpawn a command with pipes to its stdin, stdout, and optionally stderr.
 
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'.  This module provides the functions popen2(cmd)
and popen3(cmd) which return two or three pipes to the spawned command.
iÿÿÿÿNs<The popen2 module is deprecated.  Use the subprocess module.t
stacklevelitpopen2tpopen3tpopen4t SC_OPEN_MAXicCsYxRtD]I}|jdtjƒdkrytj|ƒWqQtk
rMqQXqqWdS(Nt
_deadstatei(t_activetpolltsystmaxinttremovet
ValueError(tinst((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyt_cleanups  tPopen3cBsJeZdZdZedd„Zd„Zd„Zdd„Z    d„Z
RS(s{Class representing a child process.  Normally, instances are created
    internally by the functions popen2() and popen3().iÿÿÿÿc
Cs;tƒ||_tjƒ\}}tjƒ\}}|rOtjƒ\}}    ntjƒ|_|jdkr¶tj|dƒtj|dƒ|r¦tj|    dƒn|j|ƒntj|ƒtj    |d|ƒ|_
tj|ƒtj    |d|ƒ|_ |r.tj|    ƒtj    |d|ƒ|_ n    d|_ dS(sdThe parameter 'cmd' is the shell command to execute in a
        sub-process.  On UNIX, 'cmd' may be a sequence, in which case arguments
        will be passed directly to the program without shell intervention (as
        with os.spawnv()).  If 'cmd' is a string it will be passed to the shell
        (as with os.system()).   The 'capturestderr' flag, if true, specifies
        that the object should capture standard error output of the child
        process.  The default is false.  If the 'bufsize' parameter is
        specified, it specifies the size of the I/O buffers to/from the child
        process.iiitwtrN(R tcmdtostpipetforktpidtdup2t
_run_childtclosetfdopenttochildt    fromchildtchilderrtNone(
tselfRt capturestderrtbufsizetp2creadtp2cwritetc2preadtc2pwriteterroutterrin((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyt__init__(s*
       cCsE|jdtjƒ|jdkrAtdk    rAtj|ƒqAndS(NRi(RRR    tstsRRtappend(R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyt__del__Js cCs^t|tƒr!dd|g}ntjdtƒztj|d|ƒWdtjdƒXdS(Ns/bin/shs-ciii(t
isinstancet
basestringRt
closerangetMAXFDtexecvpt_exit(RR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyRRs cCs…|jdkr~y=tj|jtjƒ\}}||jkrK||_nWq~tjk
rz|dk    r{||_q{q~Xn|jS(shReturn the exit status of the child process if it has finished,
        or -1 if it hasn't finished yet.iN(R(RtwaitpidRtWNOHANGterrorR(RRRR(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR[s cCsR|jdkrKtj|jdƒ\}}||jks?t‚||_n|jS(s9Wait for and return the exit status of the child process.i(R(RR1RtAssertionError(RRR(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pytwaitis
 N( t__name__t
__module__t__doc__R(tFalseR'R*RRRR5(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR"s"             tPopen4cBseZdZdd„ZRS(iÿÿÿÿcCsàtƒ||_tjƒ\}}tjƒ\}}tjƒ|_|jdkr’tj|dƒtj|dƒtj|dƒ|j|ƒntj|ƒtj    |d|ƒ|_
tj|ƒtj    |d|ƒ|_ dS(NiiiRR( R RRRRRRRRRRR(RRR R!R"R#R$((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR'ws      N(R6R7RRR'(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR:tsitwintos2emxttcCs%tj|||ƒ\}}||fS(s¸Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout, child_stdin) are returned.(RR(RR tmodeRR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyRscCs+tj|||ƒ\}}}|||fS(sÆExecute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout, child_stdin, child_stderr) are returned.(RR(RR R>RRte((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR—scCs%tj|||ƒ\}}||fS(s¿Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout_stderr, child_stdin) are returned.(RR(RR R>RR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR¡scCs"t|t|ƒ}|j|jfS(s¸Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout, child_stdin) are returned.(RR9RR(RR R>R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR«scCs(t|t|ƒ}|j|j|jfS(sÆExecute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout, child_stdin, child_stderr) are returned.(RtTrueRRR(RR R>R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyRµscCst||ƒ}|j|jfS(s¿Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
        be a sequence, in which case arguments will be passed directly to the
        program without shell intervention (as with os.spawnv()). If 'cmd' is a
        string it will be passed to the shell (as with os.system()). If
        'bufsize' is specified, it sets the buffer size for the I/O pipes. The
        file objects (child_stdout_stderr, child_stdin) are returned.(R:RR(RR R>R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyR¿s((R8RRtwarningstwarntDeprecationWarningt__all__tsysconfR.tAttributeErrorR RR RR:tplatformRRRtextend(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/popen2.pyt<module>s.        
    
R"