[api.paths] refactoring: CACHE_PATH renamed to CACHE_DIR

This commit is contained in:
Vinicius Moreira
2021-11-25 16:09:42 -03:00
parent 25c9ed9fa3
commit 06035bb97e
11 changed files with 22 additions and 22 deletions

View File

@@ -1,12 +1,12 @@
from pathlib import Path
from bauh.api.paths import CACHE_PATH
from bauh.api.paths import CACHE_DIR
TRAY_CHECK_FILE = f'{CACHE_PATH}/notify_tray' # it is a file that signals to the tray icon it should recheck for updates
TRAY_CHECK_FILE = f'{CACHE_DIR}/notify_tray' # it is a file that signals to the tray icon it should recheck for updates
def notify_tray():
Path(CACHE_PATH).mkdir(exist_ok=True, parents=True)
Path(CACHE_DIR).mkdir(exist_ok=True, parents=True)
with open(TRAY_CHECK_FILE, 'w+') as f:
f.write('')

View File

@@ -6,7 +6,7 @@ from packaging.version import parse as parse_version
from bauh import __app_name__, __version__
from bauh.api.http import HttpClient
from bauh.api.paths import CACHE_PATH
from bauh.api.paths import CACHE_DIR
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 = f'{CACHE_PATH}/updates'
notifications_dir = f'{CACHE_DIR}/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']))