parameters: (input_filename, out_filename, relative_to_dir)
docstring: Create a forwarding header from out_filename to input_filename.
docstring_summary: Create a forwarding header from out_filename to input_filename.
docstring_tokens: Create a forwarding header from out_filename to input_filename .
function: def WriteSetupFilename(input_filename, out_filename, relative_to_dir):
    """Create a forwarding header from out_filename to input_filename."""
    # Figure out the relative path from out_filename to input_filename.
    # We can't use os.path.relpath since that's a python2.6 feature and we
    # support python 2.5.
    input_filename = NormalizePath(input_filename)
    out_filename = NormalizePath(out_filename)
    ancestor = os.path.commonprefix([input_filename, out_filename])
  
    assert os.path.isdir(ancestor)
    num_parent_dirs = 0
    out_dir = os.path.split(out_filename)[0]
    while os.path.normpath(ancestor) != os.path.normpath(out_dir):
      num_parent_dirs += 1
      out_dir = os.path.split(out_dir)[0]
  
    if sys.platform == 'win32':
      # Windows has a file path limit of 260 characters that we can hit when
      # generating these forwarding headers.  Instead of writing the full
      # relative path, just write the path relative to the WebKit/chromium dir,
      # which is in the include path.
      rel_path = input_filename[len(ancestor):]
      if relative_to_dir:
        rel_path = os.path.join(relative_to_dir, rel_path)
    else:
      rel_path = os.path.join('/'.join(['..'] * num_parent_dirs),
                              input_filename[len(ancestor):])
  
    out_file = open(out_filename, 'w')
    out_file.write("""// This file is generated.  Do not edit.
  #include "%s"
  """ % rel_path)
    out_file.close()
function_tokens: def WriteSetupFilename ( input_filename , out_filename , relative_to_dir ) : # Figure out the relative path from out_filename to input_filename. # We can't use os.path.relpath since that's a python2.6 feature and we # support python 2.5. input_filename = NormalizePath ( input_filename ) out_filename = NormalizePath ( out_filename ) ancestor = os . path . commonprefix ( [ input_filename , out_filename ] ) assert os . path . isdir ( ancestor ) num_parent_dirs = 0 out_dir = os . path . split ( out_filename ) [ 0 ] while os . path . normpath ( ancestor ) != os . path . normpath ( out_dir ) : num_parent_dirs += 1 out_dir = os . path . split ( out_dir ) [ 0 ] if sys . platform == 'win32' : # Windows has a file path limit of 260 characters that we can hit when # generating these forwarding headers.  Instead of writing the full # relative path, just write the path relative to the WebKit/chromium dir, # which is in the include path. rel_path = input_filename [ len ( ancestor ) : ] if relative_to_dir : rel_path = os . path . join ( relative_to_dir , rel_path ) else : rel_path = os . path . join ( '/' . join ( [ '..' ] * num_parent_dirs ) , input_filename [ len ( ancestor ) : ] ) out_file = open ( out_filename , 'w' ) out_file . write ( """// This file is generated.  Do not edit.
  #include "%s"
  """ % rel_path ) out_file . close ( )