tools/code_coverage/coverage.py
def _GetBuildArgs():
  """Parses args.gn file and returns results as a dictionary.

  Returns:
    A dictionary representing the build args.
  """
  global _BUILD_ARGS
  if _BUILD_ARGS is not None:
    return _BUILD_ARGS

  _BUILD_ARGS = {}
  build_args_path = os.path.join(BUILD_DIR, 'args.gn')
  assert os.path.exists(build_args_path), ('"%s" is not a build directory, '
                                           'missing args.gn file.' % BUILD_DIR)
  with open(build_args_path) as build_args_file:
    build_args_lines = build_args_file.readlines()

  for build_arg_line in build_args_lines:
    build_arg_without_comments = build_arg_line.split('#')[0]
    key_value_pair = build_arg_without_comments.split('=')
    if len(key_value_pair) != 2:
      continue

    key = key_value_pair[0].strip()

    # Values are wrapped within a pair of double-quotes, so remove the leading
    # and trailing double-quotes.
    value = key_value_pair[1].strip().strip('"')
    _BUILD_ARGS[key] = value

  return _BUILD_ARGS
Parses args.gn file and returns results as a dictionary.

  Returns:
    A dictionary representing the build args.
  
Parses args.gn file and returns results as a dictionary.
Parses args . gn file and returns results as a dictionary .
def _GetBuildArgs():
  global _BUILD_ARGS
  if _BUILD_ARGS is not None:
    return _BUILD_ARGS
  _BUILD_ARGS = {}
  build_args_path = os.path.join(BUILD_DIR, 'args.gn')
  assert os.path.exists(build_args_path), ('"%s" is not a build directory, '
                                           'missing args.gn file.' % BUILD_DIR)
  with open(build_args_path) as build_args_file:
    build_args_lines = build_args_file.readlines()
  for build_arg_line in build_args_lines:
    build_arg_without_comments = build_arg_line.split('#')[0]
    key_value_pair = build_arg_without_comments.split('=')
    if len(key_value_pair) != 2:
      continue
    key = key_value_pair[0].strip()
    value = key_value_pair[1].strip().strip('"')
    _BUILD_ARGS[key] = value
  return _BUILD_ARGS
def _GetBuildArgs ( ) : global _BUILD_ARGS if _BUILD_ARGS is not None : return _BUILD_ARGS _BUILD_ARGS = { } build_args_path = os . path . join ( BUILD_DIR , 'args.gn' ) assert os . path . exists ( build_args_path ) , ( '"%s" is not a build directory, ' 'missing args.gn file.' % BUILD_DIR ) with open ( build_args_path ) as build_args_file : build_args_lines = build_args_file . readlines ( ) for build_arg_line in build_args_lines : build_arg_without_comments = build_arg_line . split ( '#' ) [ 0 ] key_value_pair = build_arg_without_comments . split ( '=' ) if len ( key_value_pair ) != 2 : continue key = key_value_pair [ 0 ] . strip ( ) value = key_value_pair [ 1 ] . strip ( ) . strip ( '"' ) _BUILD_ARGS [ key ] = value return _BUILD_ARGS
Parses args.gn file and returns results as a dictionary.
Parses args . gn file and returns results as a dictionary .
"""Parses args.gn file and returns results as a dictionary.

  Returns:
    A dictionary representing the build args.
  """ # Values are wrapped within a pair of double-quotes, so remove the leading # and trailing double-quotes.
A dictionary representing the build args.
A dictionary representing the build args .