ž «ÿf¥!c@sõdZddlZddlZddlmZmZddlmZddlm Z ddddd„Z d d „Z dddd d „Z dddd d„Z ejdkrÍddlmZdadanddddd„Zddd„ZdS(uì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. iN(uDistutilsPlatformErroruDistutilsExecError(uDEBUG(ulogicCs’t|ƒ}tjdkr1t||d|ƒn]tjdkrVt||d|ƒn8tjdkr{t||d|ƒntdtjƒ‚dS(uRun 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 '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. uposixudry_rununtuos2u1don't know how to spawn programs on platform '%s'N(ulistuosunameu _spawn_posixu _spawn_ntu _spawn_os2uDistutilsPlatformError(ucmdu search_pathuverboseudry_run((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyuspawns uspawncCs>x7t|ƒD])\}}d|kr d|||ts›|}ntjjd || jfƒtjd ƒWYdd} ~ XnXtsç|}ntjjd |ƒtjd ƒnjxgytj| dƒ\} } Wnutk r¡} zUddl} | j| jkrcwntsr|}ntd|| jdfƒ‚WYdd} ~ XnXtj | ƒrâtsÀ|}ntd|tj!| ƒfƒ‚qtj"| ƒr8tj#| ƒ}|dkrdSts|}ntd||fƒ‚qtj$| ƒrMqqts\|}ntd|| fƒ‚qdS(Nu iudarwinuMACOSX_DEPLOYMENT_TARGETucSsg|]}t|ƒ‘qS((uint(u.0ux((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyu s u _spawn_posix..u.cSsg|]}t|ƒ‘qS((uint(u.0ux((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyu …s uF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configureuunable to execute %r: %s iu(unable to execute %r for unknown reasonsucommand %r failed: %su"command %r terminated by signal %du%command %r failed with exit status %du1unknown error executing %r: termination status %diÿÿÿÿ(%uloguinfoujoinuosuexecvpuexecvuNoneusysuplatformu _cfg_targetu sysconfiguget_config_varusplitu_cfg_target_splituenvironugetuDistutilsPlatformErrorudictuexecvpeuexecveuforkuOSErroruDEBUGustderruwriteustrerroru_exituwaitpiduerrnouEINTRuDistutilsExecErroruargsu WIFSIGNALEDuWTERMSIGu WIFEXITEDu WEXITSTATUSu WIFSTOPPED(ucmdu search_pathuverboseudry_runu executableuexec_fnuenvu cur_targetumy_msgupidueustatusuexcuerrnou exit_status((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyu _spawn_posixrsŒ  ""            -    u _spawn_posixcCs×|dkrtjd}n|jtjƒ}tjj|ƒ\}}tjdksdtj dkr}|dkr}|d}ntjj |ƒsÏx9|D]1}tjj ||ƒ}tjj |ƒr–|Sq–WdS|SdS(uÚTries 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. uPATHuwin32uos2u.exeN( uNoneuosuenvironusplitupathsepupathusplitextusysuplatformunameuisfileujoin(u executableupathupathsubaseuextupuf((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyufind_executableÆs *  ufind_executable(u__doc__usysuosudistutils.errorsuDistutilsPlatformErroruDistutilsExecErrorudistutils.debuguDEBUGu distutilsuloguspawnu_nt_quote_argsu _spawn_ntu _spawn_os2uplatformu sysconfiguNoneu _cfg_targetu_cfg_target_splitu _spawn_posixufind_executable(((u4/opt/alt/python33/lib64/python3.3/distutils/spawn.pyus    T