[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

@@ -2,7 +2,7 @@ from pathlib import Path
from bauh.api.paths import CACHE_PATH
TRAY_CHECK_FILE = '{}/notify_tray'.format(CACHE_PATH) # it is a file that signals to the tray icon it should recheck for updates
TRAY_CHECK_FILE = f'{CACHE_PATH}/notify_tray' # it is a file that signals to the tray icon it should recheck for updates
def notify_tray():

View File

@@ -5,8 +5,8 @@ from pathlib import Path
from packaging.version import parse as parse_version
from bauh import __app_name__, __version__
from bauh.api.paths import CACHE_PATH
from bauh.api.http import HttpClient
from bauh.api.paths import CACHE_PATH
from bauh.commons.html import bold, link
from bauh.view.util.translation import I18n
@@ -33,7 +33,7 @@ def check_for_update(logger: logging.Logger, http_client: HttpClient, i18n: I18n
break
if latest and latest.get('tag_name'):
notifications_dir = '{}/updates'.format(CACHE_PATH)
notifications_dir = f'{CACHE_PATH}/updates'
release_file = '{}/{}{}'.format(notifications_dir, '' if not tray else 'tray_', latest['tag_name'])
if os.path.exists(release_file):
logger.info("Release {} already notified".format(latest['tag_name']))

View File

@@ -11,7 +11,7 @@ from colorama import Fore
from bauh import __app_name__
from bauh.api.abstract.controller import SoftwareManager
from bauh.api.paths import CACHE_PATH, CONFIG_PATH
from bauh.api.paths import CONFIG_PATH, CACHE_PATH
from bauh.commons.system import run_cmd
from bauh.view.util import resource