Make also compatible to pip package pyxdg

master
Felix Stupp 3 years ago
parent 3b7dfdc181
commit 723f578e8b
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -10,6 +10,12 @@ import time
# tries to follow XDG Base Directory Specification, if it fails due to a missing module, uses default cache dir ~/.cache
try:
# pip package: pyxdg
import xdg.BaseDirectory
CACHE_DIR = Path(xdg.BaseDirectory.xdg_cache_home)
except ModuleNotFoundError:
try:
# pip package: xdg
import xdg
CACHE_DIR = xdg.xdg_cache_home()
except ModuleNotFoundError:

Loading…
Cancel
Save