def ConvertVCMacrosToMSBuild(s):
 if ('$' in s):
  replace_map = {'$(ConfigurationName)': '$(Configuration)', '$(InputDir)': '%(RelativeDir)', '$(InputExt)': '%(Extension)', '$(InputFileName)': '%(Filename)%(Extension)', '$(InputName)': '%(Filename)', '$(InputPath)': '%(Identity)', '$(ParentName)': '$(ProjectFileName)', '$(PlatformName)': '$(Platform)', '$(SafeInputName)': '%(Filename)'}
  for (old, new) in replace_map.iteritems():
   s = s.replace(old, new)
  s = FixVCMacroSlashes(s)
 return s

def ConvertVCMacrosToMSBuild ( s ) : if ( '$' in s ) : replace_map = { '$(ConfigurationName)' : '$(Configuration)' , '$(InputDir)' : '%(RelativeDir)' , '$(InputExt)' : '%(Extension)' , '$(InputFileName)' : '%(Filename)%(Extension)' , '$(InputName)' : '%(Filename)' , '$(InputPath)' : '%(Identity)' , '$(ParentName)' : '$(ProjectFileName)' , '$(PlatformName)' : '$(Platform)' , '$(SafeInputName)' : '%(Filename)' } for ( old , new ) in replace_map . iteritems ( ) : s = s . replace ( old , new ) s = FixVCMacroSlashes ( s ) return s
convert the the msvs macros found in the string to the msbuild equivalent .