ó  îRac@sqdZddlZddlZddlZddlZddljZd„Zd„Z de fd„ƒYZ dS(s+Visual Studio user preferences file writer.iÿÿÿÿNcCs’d|ksd|kr|Stjjddƒjtjƒ}xN|D]F}tjj||ƒ}tjj|ƒrDtj|tj ƒrD|SqDW|S(s{If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so anything needing to be built needs to have a full path.t/s\tPATHt( tostenvirontgettsplittpathseptpathtjointisfiletaccesstX_OK(tcommandtpathsRtitem((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyt_FindCommandInPaths! 'cCsg}xt|D]l}|jdƒdkrMdj|jdƒƒ}d|}ntjd|ƒrld|}n|j|ƒq W|S(Nt"iÿÿÿÿs""s"%s"s[ \t\n](tfindR Rtretsearchtappend(targstnew_argstarg((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyt_QuoteWin32CommandLineArgs&s   tWritercBs8eZdZd„Zd„Zidd„Zd„ZRS(s(Visual Studio XML user user file writer.cCs(||_||_||_i|_dS(s—Initializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file. N(tuser_file_pathtversiontnametconfigurations(tselfRRR((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyt__init__9s   cCsdi|d6g|j|}dj|ƒ}nd}di|d6|d6dj|dƒd 6tjƒd 6|d 6d d 6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6g} ||jkrP|j |ƒn|j|j | ƒd"S(#s;Adds a DebugSettings node to the user file for a particular config. Args: command: command line to run. First element in the list is the executable. All elements of the command will be quoted if necessary. working_directory: other files which may trigger the rule. (optional) is%s="%s"t Rt DebugSettingstCommandtWorkingDirectoryitCommandArgumentst RemoteMachinet EnvironmentttruetEnvironmentMergetfalsetAttacht3t DebuggerTypet1tRemotet RemoteCommandtHttpUrltPDBPatht SQLDebuggingt0tDebuggerFlavort MPIRunCommandtMPIRunArgumentstMPIRunWorkingDirectorytApplicationCommandtApplicationArgumentst ShimCommandt MPIAcceptModetMPIAcceptFilterN( RRt isinstancetdicttitemsR tsockett gethostnameRR#R( Rt config_nameR t environmenttworking_directoryt abs_commandtkeytvaltenv_listtn_cmd((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pytAddDebugSettingsNsB ,   cCs‚dg}x0t|jjƒƒD]\}}|j|ƒqWdi|jjƒd6|jd6|g}tj||j ddƒdS(sWrites the user file.tConfigurationstVisualStudioUserFiletVersionR"tencodings Windows-1252N( tsortedRRCRRtProjectVersionRteasy_xmltWriteXmlIfChangedR(Rtconfigstconfigtspectcontent((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pytWriteIfChanged‡s "  (t__name__t __module__t__doc__R R#RNR[(((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyR6s   8( R^RRRDt gyp.commontgypt gyp.easy_xmlRURRtobjectR(((sn/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyts