ó  îRac@sJdZddlZddlZd„Zdefd„ƒYZd„ZdS(sÁPython module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. iÿÿÿÿNcCs(|jddƒjddƒjddƒS(Ns$ s$$ t t:s$:(treplace(tword((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyt escape_pathstWriterc BsªeZdd„Zd„Zd„Zdd„Zd„Zddededddd„Z ddddd„Z d „Z d „Z d „Z d „Zdd „Zd„ZRS(iNcCs||_||_dS(N(toutputtwidth(tselfRR((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyt__init__s cCs|jjdƒdS(Ns (Rtwrite(R((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytnewlinescCs@x9tj||jdƒD]}|jjd|dƒqWdS(Nis# s (ttextwraptwrapRRR (Rttexttline((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytcomments icCsX|dkrdSt|tƒr:djtd|ƒƒ}n|jd||f|ƒdS(NRs%s = %s(tNonet isinstancetlisttjointfiltert_line(Rtkeytvaluetindent((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytvariables  cCs+|jd|ƒ|jd|ddƒdS(Nspool %stdepthRi(RR(RtnameR((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytpool%sc Cs#|jd|ƒ|jd|ddƒ|rF|jd|ddƒn|re|jd|ddƒn|r„|jddddƒn|r£|jd |ddƒn|rÂ|jd dddƒn|rá|jd |ddƒn| r|jd | ddƒn| r|jd | ddƒndS(Nsrule %stcommandRit descriptiontdepfilet generatort1Rtrestattrspfiletrspfile_contenttdeps(RR( RRRRR R!RR#R$R%R&((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytrule)s$c CsY|j|ƒ}|j|ƒ}ttt|ƒƒ}ttt|ƒƒ}|r„tt|j|ƒƒ}|jdƒ|j|ƒn|r¿tt|j|ƒƒ}|jdƒ|j|ƒn|jddj|ƒdj|g|ƒfƒ|rUt|t ƒrt |j ƒƒ} n t |ƒ} x-| D]"\} } |j | | ddƒq,Wn|S(Nt|s||s build %s: %sRRi( t_as_listRtmapRtappendtextendRRRtdicttitertitemsR( RtoutputsR'tinputstimplicitt order_onlyt variablest all_inputst out_outputstiteratorRtval((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytbuild?s*   cCs|jd|ƒdS(Ns include %s(R(Rtpath((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytinclude]scCs|jd|ƒdS(Ns subninja %s(R(RR:((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytsubninja`scCs'|jddj|j|ƒƒƒdS(Ns default %sR(RRR)(Rtpaths((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytdefaultcscCsKd}|d}x4|dkrF||dkrF|d7}|d8}qW|S(s<Returns the number of '$' characters right in front of s[i].iit$((Rtstit dollar_countt dollar_index((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyt_count_dollars_before_indexfs   cCspd|}xGt|ƒt|ƒ|jkrS|jt|ƒtdƒ}|}xKtrœ|jdd|ƒ}|dks•|j||ƒddkrRPqRqRW|dkr|d}xOtr|jd|dƒ}|dksú|j||ƒddkr¶Pq¶q¶Wn|dkrPn|jj||d|!dƒ||d}d|d}q W|jj||dƒd S( s3Write 'text' word-wrapped at self.width characters.s s $Riiis $ s N(tlenRtTruetrfindRDtfindRR (RRRt leading_spacetavailable_spacetspace((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyRos, "        cCs*|dkrgSt|tƒr#|S|gS(N(RRR(Rtinput((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyR)“s  N(t__name__t __module__R R RRRRtFalseR'R9R;R<R>RDRR)(((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyRs             $cCs(d|kstdƒ‚|jddƒS(sbEscape a string such that it can be embedded into a Ninja file without further interpretation.s s$Ninja syntax does not allow newlinesR?s$$(tAssertionErrorR(tstring((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pytescape›s(t__doc__R treRtobjectRRR(((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/ninja_syntax.pyt s    ‰