jdxi_editor.resources

Resource path utilities for locating files in bundled applications.

Attributes

_PACKAGE_ROOT

_INSTALLED_BUNDLE

Functions

_macos_app_resources_dir() → pathlib.Path | None

Return Contents/Resources for a macOS .app bundle.

_resource_base_path() → str

Directory that contains resources/, doc/, etc.

resource_path(relative_path) → str

Resolve a path relative to the project / bundle root.

Module Contents

jdxi_editor.resources._PACKAGE_ROOT[source]
jdxi_editor.resources._INSTALLED_BUNDLE[source]
jdxi_editor.resources._macos_app_resources_dir() → pathlib.Path | None[source]

Return Contents/Resources for a macOS .app bundle.

sys.executable is …/MyApp.app/Contents/MacOS/MyApp under py2app.

jdxi_editor.resources._resource_base_path() → str[source]

Directory that contains resources/, doc/, etc.

jdxi_editor.resources.resource_path(relative_path: str | pathlib.Path) → str[source]

Resolve a path relative to the project / bundle root.

Parameters:

relative_path – Path relative to the repository root (e.g. resources/foo.png).

Returns:

Absolute path string.