1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00
Rare/rare/utils/paths.py
Stelios Tsampas 1c296474c5 Add a bunch of accumulated fixes.
Shared: Require an argument to initialize the each singleton, if it is called uninitialized, raise a RuntimeError
InstallDialog: Use QCheckBox label for the information text and remove the layout
LaunchDialog: Minor code clarity improvements
Console: add a Dialog with the process's environment variables
GameUtils: Inherit the system's environment and not a clean one
ImportGroup: Add the ability to automatically import all games in a folder
RareStyle: Use rgb values, remove hex codes and rgba values
IndicatorLineEdit/PathEdit: Infer object names from class name, don't override layout method
Models: Type fields as Optional (`Union[<something>, None]`)
Paths: Use pathlib for everything

Signed-off-by: Stelios Tsampas <loathingkernel@gmail.com>
2022-05-05 13:27:39 +03:00

14 lines
511 B
Python

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)