|
|
|
@ -10,9 +10,15 @@ 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:
|
|
|
|
|
except ModuleNotFoundError:
|
|
|
|
|
CACHE_DIR = Path.home() / ".cache"
|
|
|
|
|
|
|
|
|
|
GZIP_MAGIC_NUMBER = b'\x1f\x8b'
|
|
|
|
|