mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-05-02 04:52:03 -04:00
XDG directories
This commit is contained in:
BIN
__pycache__/helper.cpython-313.pyc
Normal file
BIN
__pycache__/helper.cpython-313.pyc
Normal file
Binary file not shown.
BIN
__pycache__/ui_handler.cpython-313.pyc
Normal file
BIN
__pycache__/ui_handler.cpython-313.pyc
Normal file
Binary file not shown.
BIN
__pycache__/updater.cpython-313.pyc
Normal file
BIN
__pycache__/updater.cpython-313.pyc
Normal file
Binary file not shown.
10
helper.py
10
helper.py
@@ -22,8 +22,10 @@ class SteamHelper:
|
|||||||
|
|
||||||
def load_config(self):
|
def load_config(self):
|
||||||
"""Load configuration from config.json"""
|
"""Load configuration from config.json"""
|
||||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
xdg_config_home = os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config"))
|
||||||
config_path = os.path.join(script_dir, 'config.json')
|
config_dir = os.path.join(xdg_config_home, 'creamlinux')
|
||||||
|
os.makedirs(config_dir, exist_ok=True)
|
||||||
|
config_path = os.path.join(config_dir, 'config.json')
|
||||||
|
|
||||||
# Create default config if it doesn't exist
|
# Create default config if it doesn't exist
|
||||||
if not os.path.exists(config_path):
|
if not os.path.exists(config_path):
|
||||||
@@ -64,8 +66,8 @@ class SteamHelper:
|
|||||||
|
|
||||||
def _setup_logging(self):
|
def _setup_logging(self):
|
||||||
"""Setup logging to file with detailed formatting"""
|
"""Setup logging to file with detailed formatting"""
|
||||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
xdg_cache_home = os.environ.get("XDG_CACHE_HOME", os.path.expanduser("~/.cache"))
|
||||||
log_dir = os.path.join(script_dir, 'logs')
|
log_dir = os.path.join(xdg_cache_home, 'creamlinux')
|
||||||
os.makedirs(log_dir, exist_ok=True)
|
os.makedirs(log_dir, exist_ok=True)
|
||||||
|
|
||||||
self._cleanup_old_logs(log_dir)
|
self._cleanup_old_logs(log_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user