2021-02-10 23:48:25 +13:00
|
|
|
import os
|
2021-02-27 07:28:54 +13:00
|
|
|
|
2021-12-19 12:08:07 +13:00
|
|
|
__version__ = "1.8.1"
|
2021-12-16 10:42:36 +13:00
|
|
|
code_name = "Stellula Kakopo"
|
2021-08-14 07:24:03 +12:00
|
|
|
|
2021-11-23 07:15:46 +13:00
|
|
|
import platform
|
|
|
|
|
2021-06-09 04:59:29 +12:00
|
|
|
resources_path = os.path.join(os.path.dirname(__file__), "resources")
|
2021-09-19 02:34:43 +12:00
|
|
|
data_dir = ""
|
2021-08-14 07:24:03 +12:00
|
|
|
|
|
|
|
# Cache Directory: Store images
|
|
|
|
if p := os.getenv("XDG_CACHE_HOME"):
|
|
|
|
cache_dir = os.path.join(p, "rare/cache")
|
|
|
|
elif os.name == "nt":
|
|
|
|
cache_dir = os.path.expandvars("%APPDATA%/rare/cache")
|
2021-11-23 07:15:46 +13:00
|
|
|
elif platform.system() == "Darwin":
|
|
|
|
cache_dir = os.path.expanduser("~/Library/rare/cache")
|
2021-08-14 07:24:03 +12:00
|
|
|
else:
|
|
|
|
cache_dir = os.path.expanduser("~/.cache/rare/")
|
2021-08-23 08:43:08 +12:00
|
|
|
|
2021-08-14 07:24:03 +12:00
|
|
|
if not os.path.exists(cache_dir):
|
|
|
|
os.makedirs(cache_dir)
|
|
|
|
|
|
|
|
# Data Directory: Images
|
|
|
|
if p := os.getenv("XDG_DATA_HOME"):
|
|
|
|
data_dir = os.path.join(p, "rare")
|
|
|
|
if os.name == "nt":
|
|
|
|
data_dir = os.path.expandvars("%APPDATA%/rare/")
|
2021-11-23 07:15:46 +13:00
|
|
|
elif platform.system() == "Darwin":
|
2021-11-23 09:08:58 +13:00
|
|
|
data_dir = os.path.expanduser("~/Library/rare/")
|
2021-08-14 07:24:03 +12:00
|
|
|
else:
|
|
|
|
data_dir = os.path.expanduser("~/.local/share/rare/")
|
|
|
|
if not os.path.exists(data_dir):
|
|
|
|
os.makedirs(data_dir)
|
2021-08-17 09:08:15 +12:00
|
|
|
|
|
|
|
image_dir = os.path.join(data_dir, "images")
|
2021-09-21 07:13:38 +12:00
|
|
|
if not os.path.exists(image_dir):
|
|
|
|
os.mkdir(image_dir)
|