From 0a5faa2bdee9afe1a273120fcb5e8d9baf1a356f Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sun, 2 Aug 2020 13:22:05 -0600 Subject: [PATCH] Fixed resolve_path logic --- sublime/dbus/manager.py | 2 +- sublime/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sublime/dbus/manager.py b/sublime/dbus/manager.py index 169a358..c61633e 100644 --- a/sublime/dbus/manager.py +++ b/sublime/dbus/manager.py @@ -70,7 +70,7 @@ class DBusManager: "org.mpris.MediaPlayer2.TrackList.xml", ] for spec in specs: - spec_path = resolve_path(f"dbus/mpris_specs/{spec}") + spec_path = resolve_path("dbus/mpris_specs", spec) with open(spec_path) as f: node_info = Gio.DBusNodeInfo.new_for_xml(f.read()) diff --git a/sublime/util.py b/sublime/util.py index 91f6309..406d5f3 100644 --- a/sublime/util.py +++ b/sublime/util.py @@ -5,7 +5,7 @@ from typing import Union def resolve_path(*joinpath_args: Union[str, Path]) -> Path: roots = (Path(__file__).parent, Path("/usr/share/sublime-music")) for root in roots: - if fullpath := root.joinpath(*joinpath_args).resolve(): + if (fullpath := root.joinpath(*joinpath_args).resolve()).exists(): return fullpath raise FileNotFoundError(