def QuoteShellArgument(arg, flavor):
 if re.match('^[a-zA-Z0-9_=.\\\\/-]+$', arg):
  return arg
 if (flavor == 'win'):
  return gyp.msvs_emulation.QuoteForRspFile(arg)
 return (("'" + arg.replace("'", (("'" + '"\'"') + "'"))) + "'")

def QuoteShellArgument ( arg , flavor ) : if re . match ( '^[a-zA-Z0-9_=.\\\\/-]+$' , arg ) : return arg if ( flavor == 'win' ) : return gyp . msvs_emulation . QuoteForRspFile ( arg ) return ( ( "'" + arg . replace ( "'" , ( ( "'" + '"\'"' ) + "'" ) ) ) + "'" )
quote a string such that it will be interpreted as a single argument by the shell .