N
εωO5c       s7   d  Z  d   Z d   Z d   Z d   Z d   Z d S(   sO  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.]
c    s   t  d t |    Sd S(   s-   Return output of "ls -ld <file>" in a string.s   ls -ldN(   s	   getoutputs   mkargs   file(   s   files2   /var/tmp/python-root/usr/lib/python1.5/commands.pys	   getstatus s     c    s   t  |   d Sd S(   s=   Return output (stdout or stderr) of executing cmd in a shell.i   N(   s   getstatusoutputs   cmd(   s   cmds2   /var/tmp/python-root/usr/lib/python1.5/commands.pys	   getoutput( s     c    s~   k  } | i d |  d d  } | i   } | i   } | t j o
 d } n | d d j o | d  } n | | f Sd S(   s4   Return (status, output) of executing cmd in a shell.s   { s   ; } 2>&1s   ri    i   s   
N(	   s   oss   popens   cmds   pipes   reads   texts   closes   stss   None(   s   cmds   oss   pipes   texts   stss2   /var/tmp/python-root/usr/lib/python1.5/commands.pys   getstatusoutput0 s      
 c    s#   k  } t | i i |  |   Sd  S(   N(   s   oss   mkargs   paths   joins   heads   x(   s   heads   xs   oss2   /var/tmp/python-root/usr/lib/python1.5/commands.pys   mk2arg= s    c    sm   d |  j o d |  d Sn d } x5 |  d r+ } | d j o | d } n | | } q, W| d } | Sd  S(   Ns   's    's    "i    s   \$"`s   \s   "(   s   xs   ss   c(   s   xs   ss   cs2   /var/tmp/python-root/usr/lib/python1.5/commands.pys   mkargI s    	 
N(   s   __doc__s	   getstatuss	   getoutputs   getstatusoutputs   mk2args   mkarg(    s2   /var/tmp/python-root/usr/lib/python1.5/commands.pys   ? s
   					