N
SΠ9c       st   d  Z  d Z k Z k Z k Z k l d d d d  Z d   Z 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 $c    sb   t  i d j o t |  | | |  n8 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_runs7   /usr/pkg/lib/python1.5/site-packages/distutils/spawn.pys   spawn s     i   i    c    s[   xP 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   is7   /usr/pkg/lib/python1.5/site-packages/distutils/spawn.pys   _nt_quote_args0 s      c    sγ   |  d } t |   }  | o t |  p | } n | o  t i | g |  d d  GHn | o| y t	 i
 t	 i | |   } Wn1 t j
 o% } t d |  d | d f  n X| d j o 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   excs7   /usr/pkg/lib/python1.5/site-packages/distutils/spawn.pys	   _spawn_ntA s    
 !c 	   sΎ  | o t i |  d  GHn | o d  Sn | o t i p t i } t i
   } | d j o y | |  d |   WnC t j
 o7 } t i i d |  d | i f  t i d  n Xt i i d |  d  t i d  nΩ xΥ d oΝ t i | d  \ } } t i |  o$ t d |  d t i |  f  n~ t i |  o? t i |  } | d j o d  Sn t d |  d | f  n/ 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_statuss7   /usr/pkg/lib/python1.5/site-packages/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 |   oK x@ | d r6 } t i  i | |   } t i  i |  o | Sn q Wt 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   fs7   /usr/pkg/lib/python1.5/site-packages/distutils/spawn.pys   find_executable s     	 N(   s   __doc__s   __revision__s   syss   oss   strings   distutils.errorss   *s   spawns   _nt_quote_argss	   _spawn_nts   _spawn_posixs   Nones   find_executable(    s7   /usr/pkg/lib/python1.5/site-packages/distutils/spawn.pys   ? s   	8