PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/alt/alt-nodejs8/root/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/
Upload File :
Current File : //opt/alt/alt-nodejs8/root/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.pyo

�
��Rac@sCdZddlmZddlZddlZddlmZddlmZdZye	Wne
k
rxd�Z	nXe�Zdadefd	��YZd
efd��YZdd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedkr?ejeej��ndS(s�Make the format of a vcproj really pretty.

   This script normalize and sort an xml. It also fetches all the properties
   inside linked vsprops and include them explicitly in the vcproj.

   It outputs the resulting xml to stdout.
i����(tprint_functionN(tparse(tNodesnsylvain (Nicolas Sylvain)cCs||k||kS(N((txty((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytcmpstCmpTuplecBseZdZd�ZRS(s!Compare function between 2 tuple.cCst|d|d�S(Ni(R(tselfRR((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyt__call__%s(t__name__t
__module__t__doc__R(((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyR#stCmpNodecBseZdZd�ZRS(s%Compare function between 2 xml nodes.cCs"d�}t||�||��S(NcSs�d}||j7}|jr,||j7}n|jr�||jd�7}g}x0|jj�D]\}}|j||f�q^W|jt��x+|D] \}}||7}||7}q�Wn|S(NtnodetName(tnodeNamet	nodeValuet
attributestgetAttributetitemstappendtsortR(R
tnode_stringt	all_nodestnametvalue((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyt
get_string-s
		
(R(RRRR((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyR,s	(R	R
RR(((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyR)sicCs�|jtjkrI|jj�rEtdd||jj�f�ndS|jr_|j�nd}|jr}|jj	}n|dkr�tdd||j
f�n�tdd||j
f�g}x@|jj�D]/\}}|j||f�|j
t��q�Wx/|D]'\}}tdd|||f�qWtdd|�|jrvtdd||jf�nx%|jD]}t|d	|d
�q�Wtdd||j
f�dS(Ns%s%st is%s<%s>s%s<%ss%s  %s="%s"s%s>s%s  %stindentis%s</%s>(tnodeTypeRt	TEXT_NODEtdatatstriptprintt
childNodest	normalizeRtlengthRRRRRRtPrettyPrintNode(R
Rt
attr_counttall_attributesRRtsub_node((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyR%Es0$	
		cCsrg}|jr(|jd�dkr(gSxC|jD]8}|jdkr]|jt|��q2|j|�q2W|S(s-Returns a list of all the node and sub nodes.Rt_excluded_filestFilter(RRR"Rtextendt
FlattenFilterR(R
t	node_listtcurrent((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyR,gs	cCs�g}x�|D]�}|r
x$tD]}|j|t|�}q Wtj|�|jd�}|jd�r{|j|�q�|jtjj|��q
q
W|S(Ns"' t$(	tREPLACEMENTStreplacetostchdirR t
startswithRtpathtabspath(t	filenamestcurrent_directorytnew_listtfilenametkey((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytFixFilenamesys


 cCs�|jr�x�|jj�D]x\}}|d
kr{|jd�}t|tjjtd��}|j|dj	|��n|s|j
|�qqWnd	S(s=Makes all the properties we know about in this node absolute.tInheritedPropertySheetstRelativePathtAdditionalIncludeDirectoriestIntermediateDirectorytOutputDirectorytAdditionalLibraryDirectoriest;iN(R=R>R?R@RARB(RRtsplitR<R2R5tdirnamet	ARGUMENTStsetAttributetjointremoveAttribute(R
RRt	path_listR9((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytAbsoluteNode�s		c
Cs8x%|jD]}t|�t|�q
Wxh|jD]]}|jtjkr2|jjdd�|_|jjdd�|_|jj�|_q2q2W|j	r9x�|j	j
�D]�\}}t|jd��}g}x-|D]%}|j
|�s�|j|�q�q�W|j|dj|��|s�|j|�q�q�Wn|jrO|j�ng}xf|jr�|jdr�|jd}|j|�|jdkr�|jt|��qX|j|�qXW|jt��xc|D][}	|	jdkr|	j	r|	j	jdkrq�qn|	jd	kr#q�n|j|	�q�Wd
S(s5For each sub node, we call recursively this function.s
ts
RCiR*tToolit	UserMacroN(R"RKt
CleanupVcprojRRRRR1trstripRRtsortedRDtcountRRGRHRIR#tremoveChildRR+R,RRR$tappendChild(
R
R(RRtsorted_listtunique_listtit
node_arrayR.tnew_node((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyRO�sF
	
	



	cCscg}xV|jD]K}|jdkrx3|jD]%}|jdkr/|j|�q/q/WqqW|S(NtConfigurationst
Configuration(R"RR(tvcprojtnodesR
R(((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytGetConfiguationNodes�scCsPt|�}|jjrL|jjd�}t|jd�tjj|��SgS(NR=RC(	RtdocumentElementRRR<RDR2R5RE(R:tdomtvsprops((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytGetChildrenVsprops�s
"cCs{|jtjkrdS|jd�}|s/dSxE|jD]:}|j|jkr9|jd�}||krs|Sq9q9WdS(NR(RRRtNoneRR"R(tnode1tchild2tcurrent_nameR(R((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyt
SeekToNode�scCs�|js
dSx�|jj�D]�\}}|dkr;qn|j|�}|r�||kr�|j|dj||g��q�n|j||�|dkr|j|�qqWdS(NRRCR=(RRRRGRHRI(Rdtnode2Rtvalue2tvalue1((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytMergeAttributes�s	%cCs`t||�xL|jD]A}t||�}|rBt||�q|j|jt��qWdS(N(RkR"RgtMergePropertiesRTt	cloneNodetTrue(RdRhRetchild1((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyRls
c	CsA|at|�dkr.td|d�dSx@tdt|��D])}||jd�\}}|t|<qDWt|d�}x�t|j�D]�}|j	d�}t
|j�jd�tj
j|d��}x!|D]}|jt|��q�Wx$|D]}t|t|�j�q�Wq�Wt|j�t|j�dS(s(Main function of this vcproj prettifier.is@Usage: %s "c:\path\to\vcproj.vcproj" [key1=value1] [key2=value2]iit=R=RC(RFtlenR!trangeRDR0RR^R_RR<R R2R5RER+RbRlROR%(	targvRWR;RR`tconfiguration_nodeRatvsprops_listtcurrent_vsprops((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pytmains*



t__main__( Rt
__future__RR2tsystxml.dom.minidomRRt
__author__Rt	NameErrortdictR0RcRFtobjectRRR%R,R<RKROR^RbRgRkRlRwR	texitRs(((sk/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/tools/pretty_vcproj.pyt<module>
s6

	"				;					
	1

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic