libretro.drivers.path.explicit

PathDriver implementation whose paths are supplied explicitly at construction.

See also

PathDriver

The protocol this driver implements.

Classes

ExplicitPathDriver

A path driver that supports defining individual locations for each directory.

class ExplicitPathDriver[source]

Bases: PathDriver

A path driver that supports defining individual locations for each directory.

__init__(corepath=None, system=None, assets=None, save=None, playlist=None, file_browser_start=None)[source]

Initialize a new ExplicitPathDriver, creating the specified directories if necessary.

Parameters:
  • corepath (str | bytes | PathLike[str] | PathLike[bytes] | Core | None) –

    May be one of the following:

    str, bytes, PathLike

    Path to the libretro core. Will be encoded into UTF-8 if necessary and exposed to the core with RETRO_ENVIRONMENT_GET_LIBRETRO_PATH. Not validated for existence, permissions, or correctness; i.e. this may have a different value than the loaded core’s path, but you shouldn’t do this unless you’re specifically interested in testing this scenario.

    Core

    Its path will be used as the libretro core path. The driver won’t keep a reference to the core itself.

    None

    RETRO_ENVIRONMENT_GET_LIBRETRO_PATH will be unavailable to cores.

  • system (str | bytes | PathLike[str] | PathLike[bytes] | None) – The system directory that the core can access. Can be a str, bytes, or PathLike. If None, RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY will not be available to the core.

  • assets (str | bytes | PathLike[str] | PathLike[bytes] | None) – The directory containing assets for the core. Can be a str, bytes, or PathLike. If None, RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY will not be available to the core.

  • save (str | bytes | PathLike[str] | PathLike[bytes] | None) – The directory where the core can save data. Can be a str, bytes, or PathLike. If None, RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY will not be available to the core.

  • playlist (str | bytes | PathLike[str] | PathLike[bytes] | None) – The directory where the core can read playlists. Can be a str, bytes, or PathLike. If None, RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY will not be available to the core.

  • file_browser_start (str | bytes | PathLike[str] | PathLike[bytes] | None) – The directory that a frontend’s file browser would start in. Can be a str, bytes, or PathLike. If None, RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY will not be available to the core.

Raises:

TypeError – If any of the arguments are not of the correct type.

classmethod __new__(*args, **kwargs)
property system_dir

Corresponds to EnvironmentCall.GET_SYSTEM_DIRECTORY.

If None, a core’s call to RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY should return false.

property libretro_path

Corresponds to EnvironmentCall.GET_LIBRETRO_PATH.

If None, a core’s call to RETRO_ENVIRONMENT_GET_LIBRETRO_PATH should return false.

property core_assets_dir

Corresponds to EnvironmentCall.GET_CORE_ASSETS_DIRECTORY.

If None, a core’s call to RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY should return false.

property save_dir

Corresponds to EnvironmentCall.GET_SAVE_DIRECTORY.

If None, a core’s call to RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY should return false.

property playlist_dir

Corresponds to EnvironmentCall.GET_PLAYLIST_DIRECTORY.

If None, a core’s call to RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY should return false.

property file_browser_start_dir

Corresponds to EnvironmentCall.GET_FILE_BROWSER_START_DIRECTORY.

If None, a core’s call to RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY should return false.