[api] refactoring: caching directory for root user is now /var/cache/bauh

This commit is contained in:
Vinicius Moreira
2021-11-24 10:34:04 -03:00
parent f78498c1ec
commit aa889dcd51
18 changed files with 49 additions and 42 deletions

View File

@@ -1,8 +1,9 @@
from pathlib import Path
from bauh import __app_name__
from bauh.api import user
CACHE_PATH = '{}/.cache/bauh'.format(str(Path.home()))
CACHE_PATH = f'/var/cache/{__app_name__}' if user.is_root() else f'{Path.home()}/.cache/{__app_name__}'
CONFIG_PATH = '{}/.config/bauh'.format(str(Path.home()))
USER_THEMES_PATH = '{}/.local/share/bauh/themes'.format(str(Path.home()))
DESKTOP_ENTRIES_DIR = '{}/.local/share/applications'.format(str(Path.home()))