-í
ì¶<c       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.
s5   $Id: spawn.py,v 1.11 2001/12/06 20:51:35 fdrake Exp $N(   s   *i   i    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_run(    (    s%   /usr/lib/python2.2/distutils/spawn.pys   spawn s   c    sm   0 4 < xV t  t |  ƒ ƒ D< ]? } = 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.
    s    iÿÿÿÿs   "%s"N(   s   ranges   lens   argss   is   strings   find(   s   argss   i(    (    s%   /usr/lib/python2.2/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 | |  ƒ } Wn6 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: %siÿÿÿÿs'   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   excs   rc(    (    s%   /usr/lib/python2.2/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   statuss   es   pids   exit_statuss   exec_fn(    (    s%   /usr/lib/python2.2/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[   xJ | D  ]? } ¡ 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   .exeN(   s   paths   Nones   oss   environs   strings   splits   pathseps   pathss   splitexts
   executables   bases   exts   syss   platforms   isfiles   ps   joins   f(   s
   executables   paths   pathss   fs   ps   exts   base(    (    s%   /usr/lib/python2.2/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   syss   spawns   __revision__s	   _spawn_nts   strings   _nt_quote_argss   _spawn_posixs   oss   find_executable(    (    s%   /usr/lib/python2.2/distutils/spawn.pys   ? s   	
8