Your IP : 216.73.216.249


Current Path : /proc/242857/root/opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/
Upload File :
Current File : //proc/242857/root/opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyo

�
 Qc@s�dZddlmZmZddlZddlZddlZddlZejj	ejj
e��Zd�Z
defd��YZdefd��YZed	kr�eje
ejd
��ndS(suUtility functions for Windows builds.

These functions are executed via gyp-win-tool when using the ninja generator.
i����(twindlltwintypesNcCs8t�}|j|�}|dk	r4tj|�ndS(N(tWinTooltDispatchtNonetsystexit(targstexecutort	exit_code((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytmains	tLinkLockcBs eZdZd�Zd�ZRS(s�A flock-style lock to limit the number of concurrent links to one.

  Uses a session-local mutex based on the file's directory.
  cCs}dtjdd�jdd�}tjjtjd�tjd�tj|��|_tjj	|jtjd��}dS(NsLocal\%ss\t_t:iI����(
tBASE_DIRtreplaceRtkernel32tCreateMutexWRtc_inttcreate_unicode_buffertmutextWaitForSingleObject(tselftnametresult((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt	__enter__ s"		cCs*tjj|j�tjj|j�dS(N(RRtReleaseMutexRtCloseHandle(Rttypetvaluet	traceback((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt__exit__/s(t__name__t
__module__t__doc__RR(((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyRs	RcBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(s�This class performs all the Windows tooling steps. The methods can either
  be executed directly, or dispatched from an argument list.cCsOt|�dkr!td��nd|j|d�}t||�|d�S(s(Dispatches a string command to a method.isNot enough argumentssExec%si(tlent	Exceptiont_CommandifyNametgetattr(RRtmethod((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR8scCs|j�jdd�S(s@Transforms a tool name like recursive-mirror to RecursiveMirror.t-t(ttitleR(Rtname_string((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR%@scCsNt|�j�d jd�}g|D]}|jdd�^q&}t|�S(s@Gets the saved environment from a file for a given architecture.i����st=i(topentreadtsplittdict(Rtarchtpairstitemtkvs((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt_GetEnvDs%cCst|d�j�dS(sSimple stamp command.twN(R-tclose(Rtpath((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt	ExecStampMscCs}tjj|�rDtjj|�r4tj|�qDtj|�ntjj|�ritj||�ntj||�dS(s)Emulation of rm -rf out && cp -af in out.N(	tosR8texiststisdirtshutiltrmtreetunlinktcopytreetcopy2(Rtsourcetdest((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecRecursiveMirrorQscGs�t���|j|�}tj|dtd|dtjdtj�}|j�\}}x+|j�D]}|j	d�se|GHqeqeW|j
SWdQXdS(s�Filter diagnostic output from link that looks like:
    '   Creating library ui.dll.lib and object ui.dll.exp'
    This happens when there are exports from the dll or exe.
    tshelltenvtstdouttstderrs   Creating library N(RR5t
subprocesstPopentTruetPIPEtSTDOUTtcommunicatet
splitlinest
startswitht
returncode(RR1RRFtpopentoutRtline((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecLinkWrapper]s
c
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}x.|j�D] }|r[d|kr[|GHq[q[W|jS(s�Run manifest tool with environment set. Strip out undesirable warning
    (some XML blocks are recognized by the OS loader, but not the manifest
    tool).RERFRGRHs#manifest authoring warning 81010002(	R5RIRJRKRLRMRNRORQ(RR1RRFRRRSRRT((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecManifestWrapperlsc	s�ddgt|	�d|d|d|d|d|d||g
}
|j|�}tj|
d	td
|dtjdtj�}|j�\}
}|
j�}d
�t	�fd�|D��}x2|D]*}|j
��r�||kr�|GHq�q�W|jS(sjFilter noisy filenames output from MIDL compile step that isn't
    quietable via command line flags.
    tmidls/nologos/outs/tlbs/hs/dlldatas/iids/proxyRERFRGRHsProcessing c3s0|]&}|j��rtjj|�VqdS(N(RPR:R8tbasename(t.0tx(tprefix(sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pys	<genexpr>�s(tlistR5RIRJRKRLRMRNROtsetRPRQ(RR1toutdirttlbthtdlldatatiidtproxytidltflagsRRFRRRSRtlinest
processingRT((R[sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecMidlWrapperys&

c
Gs�|j|�}|dkrdStj|dtd|dtjdtj�}|j�\}}xR|j�D]D}|jd�rk|jd�rk|jd	�rk|rk|GHqkqkW|j	S(
s/Filter logo banner from invocations of asm.exe.senvironment.x64iRERFRGRHs#Copyright (C) Microsoft CorporationsMicrosoft (R) Macro Assemblers
 Assembling: (
R5RIRJRKRLRMRNRORPRQ(RR1RRFRRRSRRT((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecAsmWrapper�sc
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}xB|j�D]4}|jd�r[|jd�r[|r[|GHq[q[W|j	S(sgFilter logo banner from invocations of rc.exe. Older versions of RC
    don't support the /nologo flag.RERFRGRHs+Microsoft (R) Windows (R) Resource Compilers#Copyright (C) Microsoft Corporation(
R5RIRJRKRLRMRNRORPRQ(RR1RRFRRRSRRT((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt
ExecRcWrapper�scGsi|j|�}t|�j�}|r1|dnd}tj|dtd|d|�}|j�|jS(s�Runs an action command line from a response file using the environment
    for |arch|. If |dir| is supplied, use that as the working directory.iRERFtcwdN(	R5R-R.RRIRJRKtwaitRQ(RR1trspfiletdirRFRRR((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecActionWrapper�s!
(R R!R"RR%R5R9RDRURVRhRiRjRo(((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR4s								
			t__main__i(R"tctypesRRR:R=RIRR8tdirnametabspatht__file__RR
tobjectRRR Rtargv(((sK//opt/alt/alt-nodejs11/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt<module>	s	�