emmental/emmental/path.py
Anna Schumaker 35d0d815ca audio: Load a track requested by the user
Either through the command line, mpris2, or the open button in the
header.

Implements: #7 (Add MPRIS2 Support)
Implements: #47 (Signal that the track has changed when it actually changes)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-04-12 10:41:58 -04:00

12 lines
315 B
Python

# Copyright 2022 (c) Anna Schumaker.
"""Extra path handling for URIs."""
import pathlib
import urllib
def from_uri(uri: str) -> pathlib.Path:
"""Make a path from a uri."""
if parsed := urllib.parse.urlparse(uri):
return pathlib.Path(urllib.parse.unquote(parsed.path))
return pathlib.Path(uri)