-ķ
É<c       s}   d  Z  d Z d k Z d k Z d k Z d k Td 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.
s5   $Id: spawn.py,v 1.11 2001/12/06 20:51:35 fdrake Exp $N(   s   *i   i    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_run(    (    s/   /usr/local/twc/lib/python2.2/distutils/spawn.pys   spawn s     c    sX   xM t  t |    D]9 } 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/local/twc/lib/python2.2/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 | |   } Wn0 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: %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/local/twc/lib/python2.2/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   statuss   es   pids   exit_statuss   exec_fn(    (    s/   /usr/local/twc/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 |   oI x> | D]6 } 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   .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/local/twc/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/local/twc/lib/python2.2/distutils/spawn.pys   ? s   	8