1
0
Fork 0
mirror of synced 2024-07-01 20:50:34 +12:00
Rare/rare/utils/paths.py

14 lines
511 B
Python
Raw Normal View History

from pathlib import Path
from PyQt5.QtCore import QStandardPaths
resources_path = Path(__file__).absolute().parent.parent.joinpath("resources")
data_dir = Path(QStandardPaths.writableLocation(QStandardPaths.DataLocation), "rare")
cache_dir = Path(QStandardPaths.writableLocation(QStandardPaths.CacheLocation), "rare")
image_dir = data_dir.joinpath("images")
tmp_dir = cache_dir.joinpath("tmp")
for path in (data_dir, cache_dir, image_dir, tmp_dir):
if not path.exists():
path.mkdir(parents=True)