def _RuleExpandPath(path, input_file):
 path = path.replace('$(InputName)', os.path.splitext(os.path.split(input_file)[1])[0])
 path = path.replace('$(InputDir)', os.path.dirname(input_file))
 path = path.replace('$(InputExt)', os.path.splitext(os.path.split(input_file)[1])[1])
 path = path.replace('$(InputFileName)', os.path.split(input_file)[1])
 path = path.replace('$(InputPath)', input_file)
 return path

def _RuleExpandPath ( path , input_file ) : path = path . replace ( '$(InputName)' , os . path . splitext ( os . path . split ( input_file ) [ 1 ] ) [ 0 ] ) path = path . replace ( '$(InputDir)' , os . path . dirname ( input_file ) ) path = path . replace ( '$(InputExt)' , os . path . splitext ( os . path . split ( input_file ) [ 1 ] ) [ 1 ] ) path = path . replace ( '$(InputFileName)' , os . path . split ( input_file ) [ 1 ] ) path = path . replace ( '$(InputPath)' , input_file ) return path
given the input file to which a rule applied .