# base.DataFiles

moderngl_window.resources.data.DataFiles

  Registry for requested data files

## Methods

DataFiles.__init__()

  Initialize internal attributes

DataFiles.load(meta: DataDescription) → Any

  Load data file with the configured loaders.

  Parameters:

    meta (`DataDescription`) – the resource description

  Returns:

    The loaded resource

  Return type:

    Any

DataFiles.add(meta: ResourceDescription) → None

  Adds a resource description without loading it. The resource is loaded and returned when `load_pool()` is called.

  Parameters:

    meta (ResourceDescription) – The resource description

DataFiles.load_pool() → Generator[Tuple[ResourceDescription, Any], None, None]

  Loads all the data files using the configured finders.

  This is only relevant when resource have been added to this pool using `add()`.

  Returns:

    Generator of (meta, resource) tuples

DataFiles.resolve_loader(meta: ResourceDescription) → None

  Attempts to assign a loader class to a ResourceDescription.

  Parameters:

    meta (`ResourceDescription`) – The resource description instance

## Attributes

DataFiles.settings_attr = 'DATA_LOADERS'

  The name of the attribute in `Settings` containting a list of loader classes.

  Type:

    str

DataFiles.count

  The number of resource descriptions added. This is only relevant when using add and load_pool.

  Type:

    int

DataFiles.loaders

  Loader classes for this resource type

  Type:

    Generator