Ζ
9Oφ9c       s     d  Z    d Z  d k Z d k Z d k Z  d k T d d d d  Z 0 d   Z A d d d d  Z [ d d d d	  Z	  e
 d
  Z d S(   sμ   distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
s4   $Id: spawn.py,v 1.10 2000/09/26 02:00:51 gward Exp $N(   s   *c    sw    $ % t  i d j o & t |  | | |  nA ' t  i d j o ( t |  | | |  n * t d t  i  d S(   sξ  Run another program, specified as a command list 'cmd', in a new
    process.  'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable search
    path will be used to find the program; otherwise, cmd[0] must be the
    exact path to the executable.  If 'verbose' is true, a one-line summary
    of the command will be printed before it is run.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    s   posixs   nts1   don't know how to spawn programs on platform '%s'N(	   s   oss   names   _spawn_posixs   cmds   search_paths   verboses   dry_runs	   _spawn_nts   DistutilsPlatformError(   s   cmds   search_paths   verboses   dry_runs,   /mit/python/lib/python2.0/distutils/spawn.pys   spawn s   i   i    c    sp   0 4 < xY t  t |    d < r@ } = t i |  | d  d j o > d |  | |  | <n q W? |  Sd S(   s©   Quote command-line arguments for DOS/Windows conventions: just
    wraps every argument which contains blanks in double quotes, and
    returns a new argument list.
    i    s    i   s   "%s"N(   s   ranges   lens   argss   is   strings   find(   s   argss   is,   /mit/python/lib/python2.0/distutils/spawn.pys   _nt_quote_args0 s    	!c    s  A F |  d } G t |   }  H | o J t |  p | } n K | o# L t i | g |  d d  GHn M | o O y P t	 i
 t	 i | |   } Wn7 Q t j
 o( } S t d |  d | d f  n XU | d j o W t d |  d | f  n n d  S(   Ni    i   s    s   command '%s' failed: %ss'   command '%s' failed with exit status %d(   s   cmds
   executables   _nt_quote_argss   search_paths   find_executables   verboses   strings   joins   dry_runs   oss   spawnvs   P_WAITs   rcs   OSErrors   excs   DistutilsExecError(   s   cmds   search_paths   verboses   dry_runs
   executables   rcs   excs,   /mit/python/lib/python2.0/distutils/spawn.pys	   _spawn_ntA s   

#$c 	   s  [ ` | o a t i |  d  GHn b | o c d  Sn d | o t i p t i } f t i
   } h | d j o i y l | |  d |   WnL m t j
 o= } n t i i d |  d | i f  p t i d  n Xr t i i d |  d  s t i d  n y xω y d oξ z t i | d  \ } } { t i |  o' | t d |  d t i |  f  n  t i |  oK  t i |  }  | d j o  d  Sn  t d |  d | f  n8  t i |  o
  qn  t d |  d | f  qWd  S(	   Ns    i    s   unable to execute %s: %s
i   s(   unable to execute %s for unknown reasonss$   command '%s' terminated by signal %ds'   command '%s' failed with exit status %ds3   unknown error executing '%s': termination status %d(   s   verboses   strings   joins   cmds   dry_runs   search_paths   oss   execvps   execvs   exec_fns   forks   pids   OSErrors   es   syss   stderrs   writes   strerrors   _exits   waitpids   statuss   WIFSIGNALEDs   DistutilsExecErrors   WTERMSIGs	   WIFEXITEDs   WEXITSTATUSs   exit_statuss
   WIFSTOPPED(	   s   cmds   search_paths   verboses   dry_runs   exec_fns   pids   es   statuss   exit_statuss,   /mit/python/lib/python2.0/distutils/spawn.pys   _spawn_posix[ s6   

$ 
'
c    s     | t j o  t i d } n  t i | t i  }  t i  i |   \ } }  t i d j o
 | d j o  |  d }  n  t i  i |   o]   xL | d   r? } ‘ t i  i | |   } ’ t i  i |  o € | Sn q± W₯ t Sn § |  Sd S(   sά   Try to find 'executable' in the directories listed in 'path' (a
    string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH']).  Returns the complete filename or None if not
    found.
    s   PATHs   win32s   .exei    N(   s   paths   Nones   oss   environs   strings   splits   pathseps   pathss   splitexts
   executables   bases   exts   syss   platforms   isfiles   ps   joins   f(   s
   executables   paths   pathss   bases   exts   ps   fs,   /mit/python/lib/python2.0/distutils/spawn.pys   find_executable s     	(   s   __doc__s   __revision__s   syss   oss   strings   distutils.errorss   spawns   _nt_quote_argss	   _spawn_nts   _spawn_posixs   Nones   find_executable(    s,   /mit/python/lib/python2.0/distutils/spawn.pys   ? s   	
8