libretro.drivers.path.temp

Types and classes for creating temporary directories for the core to use.

Classes

TempDirPathDriver

A path driver that creates temporary directories for the core to use.

class TempDirPathDriver[source]

Bases: PathDriver

A path driver that creates temporary directories for the core to use.

Test cases should add required files to these directories before running the core.

__init__(corepath=None, prefix=b'libretro.py-', ignore_cleanup_errors=True)[source]

Initialize a new TempDirPathDriver and creates the necessary directories.

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.

  • prefix (str | bytes) – A prefix that will be applied to the temporary directory’s name. Can be a str or bytes.

Raises:

TypeError – If any of the arguments are not of the specified types.

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

Path to the root directory created by this driver.

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.