(
    build_files,
    format,
    default_variables={},
    includes=[],
    depth=".",
    params=None,
    check=False,
    circular_check=True,
    duplicate_basename_check=True,
)
return [generator] + result
Loads one or more specified build files.
  default_variables and includes will be copied before use.
  Returns the generator for the specified format and the
  data returned by loading the specified build files.
Loads one or more specified build files.
  default_variables and includes will be copied before use.
  Returns the generator for the specified format and the
  data returned by loading the specified build files.
Loads one or more specified build files . default_variables and includes will be copied before use . Returns the generator for the specified format and the data returned by loading the specified build files .
def Load(
    build_files,
    format,
    default_variables={},
    includes=[],
    depth=".",
    params=None,
    check=False,
    circular_check=True,
    duplicate_basename_check=True,
):
    """
  Loads one or more specified build files.
  default_variables and includes will be copied before use.
  Returns the generator for the specified format and the
  data returned by loading the specified build files.
  """
    if params is None:
        params = {}

    if "-" in format:
        format, params["flavor"] = format.split("-", 1)

    default_variables = copy.copy(default_variables)

    # Default variables provided by this program and its modules should be
    # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace,
    # avoiding collisions with user and automatic variables.
    default_variables["GENERATOR"] = format
    default_variables["GENERATOR_FLAVOR"] = params.get("flavor", "")

    # Format can be a custom python file, or by default the name of a module
    # within gyp.generator.
    if format.endswith(".py"):
        generator_name = os.path.splitext(format)[0]
        path, generator_name = os.path.split(generator_name)

        # Make sure the path to the custom generator is in sys.path
        # Don't worry about removing it once we are done.  Keeping the path
        # to each generator that is used in sys.path is likely harmless and
        # arguably a good idea.
        path = os.path.abspath(path)
        if path not in sys.path:
            sys.path.insert(0, path)
    else:
        generator_name = "gyp.generator." + format

    # These parameters are passed in order (as opposed to by key)
    # because ActivePython cannot handle key parameters to __import__.
    generator = __import__(generator_name, globals(), locals(), generator_name)
    for (key, val) in generator.generator_default_variables.items():
        default_variables.setdefault(key, val)

    # Give the generator the opportunity to set additional variables based on
    # the params it will receive in the output phase.
    if getattr(generator, "CalculateVariables", None):
        generator.CalculateVariables(default_variables, params)

    # Give the generator the opportunity to set generator_input_info based on
    # the params it will receive in the output phase.
    if getattr(generator, "CalculateGeneratorInputInfo", None):
        generator.CalculateGeneratorInputInfo(params)

    # Fetch the generator specific info that gets fed to input, we use getattr
    # so we can default things and the generators only have to provide what
    # they need.
    generator_input_info = {
        "non_configuration_keys": getattr(
            generator, "generator_additional_non_configuration_keys", []
        ),
        "path_sections": getattr(generator, "generator_additional_path_sections", []),
        "extra_sources_for_rules": getattr(
            generator, "generator_extra_sources_for_rules", []
        ),
        "generator_supports_multiple_toolsets": getattr(
            generator, "generator_supports_multiple_toolsets", False
        ),
        "generator_wants_static_library_dependencies_adjusted": getattr(
            generator, "generator_wants_static_library_dependencies_adjusted", True
        ),
        "generator_wants_sorted_dependencies": getattr(
            generator, "generator_wants_sorted_dependencies", False
        ),
        "generator_filelist_paths": getattr(
            generator, "generator_filelist_paths", None
        ),
    }

    # Process the input specific to this generator.
    result = gyp.input.Load(
        build_files,
        default_variables,
        includes[:],
        depth,
        generator_input_info,
        check,
        circular_check,
        duplicate_basename_check,
        params["parallel"],
        params["root_targets"],
    )
    return [generator] + result
def Load ( build_files , format , default_variables = { } , includes = [ ] , depth = "." , params = None , check = False , circular_check = True , duplicate_basename_check = True , ) : if params is None : params = { } if "-" in format : format , params [ "flavor" ] = format . split ( "-" , 1 ) default_variables = copy . copy ( default_variables ) # Default variables provided by this program and its modules should be # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, # avoiding collisions with user and automatic variables. default_variables [ "GENERATOR" ] = format default_variables [ "GENERATOR_FLAVOR" ] = params . get ( "flavor" , "" ) # Format can be a custom python file, or by default the name of a module # within gyp.generator. if format . endswith ( ".py" ) : generator_name = os . path . splitext ( format ) [ 0 ] path , generator_name = os . path . split ( generator_name ) # Make sure the path to the custom generator is in sys.path # Don't worry about removing it once we are done.  Keeping the path # to each generator that is used in sys.path is likely harmless and # arguably a good idea. path = os . path . abspath ( path ) if path not in sys . path : sys . path . insert ( 0 , path ) else : generator_name = "gyp.generator." + format # These parameters are passed in order (as opposed to by key) # because ActivePython cannot handle key parameters to __import__. generator = __import__ ( generator_name , globals ( ) , locals ( ) , generator_name ) for ( key , val ) in generator . generator_default_variables . items ( ) : default_variables . setdefault ( key , val ) # Give the generator the opportunity to set additional variables based on # the params it will receive in the output phase. if getattr ( generator , "CalculateVariables" , None ) : generator . CalculateVariables ( default_variables , params ) # Give the generator the opportunity to set generator_input_info based on # the params it will receive in the output phase. if getattr ( generator , "CalculateGeneratorInputInfo" , None ) : generator . CalculateGeneratorInputInfo ( params ) # Fetch the generator specific info that gets fed to input, we use getattr # so we can default things and the generators only have to provide what # they need. generator_input_info = { "non_configuration_keys" : getattr ( generator , "generator_additional_non_configuration_keys" , [ ] ) , "path_sections" : getattr ( generator , "generator_additional_path_sections" , [ ] ) , "extra_sources_for_rules" : getattr ( generator , "generator_extra_sources_for_rules" , [ ] ) , "generator_supports_multiple_toolsets" : getattr ( generator , "generator_supports_multiple_toolsets" , False ) , "generator_wants_static_library_dependencies_adjusted" : getattr ( generator , "generator_wants_static_library_dependencies_adjusted" , True ) , "generator_wants_sorted_dependencies" : getattr ( generator , "generator_wants_sorted_dependencies" , False ) , "generator_filelist_paths" : getattr ( generator , "generator_filelist_paths" , None ) , } # Process the input specific to this generator. result = gyp . input . Load ( build_files , default_variables , includes [ : ] , depth , generator_input_info , check , circular_check , duplicate_basename_check , params [ "parallel" ] , params [ "root_targets" ] , ) return [ generator ] + result