Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/commands.pyo |
łň hRc @ sF d Z d d d g Z d Z d Z d Z d Z d Z d S( s- Execute shell commands via os.popen() and return status, output. Interface summary: import commands outtext = commands.getoutput(cmd) (exitstatus, outtext) = commands.getstatusoutput(cmd) outtext = commands.getstatus(file) # returns output of "ls -ld file" A trailing newline is removed from the output string. Encapsulates the basic operation: pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r') text = pipe.read() sts = pipe.close() [Note: it would be nice to add functions to interpret the exit status.] t getstatusoutputt getoutputt getstatusc C s t d t | S( s- Return output of "ls -ld <file>" in a string.s ls -ld( R t mkarg( t file( ( s$ /usr/local/lib/python2.5/commands.pyR ! s c C s t | d S( s= Return output (stdout or stderr) of executing cmd in a shell.i ( R ( t cmd( ( s$ /usr/local/lib/python2.5/commands.pyR * s c C s~ d d k } | i d | d d } | i } | i } | d j o d } n | d d j o | d } n | | f S( s4 Return (status, output) of executing cmd in a shell.i˙˙˙˙Ns { s ; } 2>&1t ri s ( t ost popent readt closet None( R R t pipet textt sts( ( s$ /usr/local/lib/python2.5/commands.pyR 2 s c C s% d d k } t | i i | | S( Ni˙˙˙˙( R R t patht join( t headt xR ( ( s$ /usr/local/lib/python2.5/commands.pyt mk2arg? s c C sg d | j o d | d Sn d } x3 | D]+ } | d j o | d } n | | } q* W| d } | S( Ns 's 's "s \$"`s \t "( ( R t st c( ( s$ /usr/local/lib/python2.5/commands.pyR K s N( t __doc__t __all__R R R R R ( ( ( s$ /usr/local/lib/python2.5/commands.pys <module> s