diff --git a/bauh/api/paths.py b/bauh/api/paths.py index 2f918c0e..1ca0ea63 100644 --- a/bauh/api/paths.py +++ b/bauh/api/paths.py @@ -5,7 +5,7 @@ from bauh import __app_name__ from bauh.api import user CACHE_PATH = f'/var/cache/{__app_name__}' if user.is_root() else f'{Path.home()}/.cache/{__app_name__}' -CONFIG_PATH = f'/etc/{__app_name__}' if user.is_root() else f'{Path.home()}/.config/{__app_name__}' +CONFIG_DIR = f'/etc/{__app_name__}' if user.is_root() else f'{Path.home()}/.config/{__app_name__}' USER_THEMES_PATH = '{}/.local/share/bauh/themes'.format(str(Path.home())) DESKTOP_ENTRIES_DIR = '{}/.local/share/applications'.format(str(Path.home())) TEMP_DIR = f'/tmp/{__app_name__}@{getuser()}' diff --git a/bauh/commons/config.py b/bauh/commons/config.py index 300f58d5..0ecc556a 100644 --- a/bauh/commons/config.py +++ b/bauh/commons/config.py @@ -7,13 +7,13 @@ from typing import Optional import yaml -from bauh.api.paths import CONFIG_PATH +from bauh.api.paths import CONFIG_DIR from bauh.commons import util def read_config(file_path: str, template: dict, update_file: bool = False, update_async: bool = False) -> dict: if not os.path.exists(file_path): - Path(CONFIG_PATH).mkdir(parents=True, exist_ok=True) + Path(CONFIG_DIR).mkdir(parents=True, exist_ok=True) save_config(template, file_path) else: with open(file_path) as f: diff --git a/bauh/gems/appimage/__init__.py b/bauh/gems/appimage/__init__.py index f2d6a467..5c8e30d6 100644 --- a/bauh/gems/appimage/__init__.py +++ b/bauh/gems/appimage/__init__.py @@ -2,15 +2,15 @@ import os from pathlib import Path from typing import Optional -from bauh.api.paths import CONFIG_PATH, TEMP_DIR, CACHE_PATH +from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_PATH from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) LOCAL_PATH = '{}/.local/share/bauh/appimage'.format(str(Path.home())) INSTALLATION_PATH = LOCAL_PATH + '/installed/' SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/appimage/suggestions.txt' -CONFIG_FILE = f'{CONFIG_PATH}/appimage.yml' -APPIMAGE_CONFIG_DIR = f'{CONFIG_PATH}/appimage' +CONFIG_FILE = f'{CONFIG_DIR}/appimage.yml' +APPIMAGE_CONFIG_DIR = f'{CONFIG_DIR}/appimage' UPDATES_IGNORED_FILE = f'{APPIMAGE_CONFIG_DIR}/updates_ignored.txt' SYMLINKS_DIR = '{}/.local/bin'.format(str(Path.home())) URL_COMPRESSED_DATABASES = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/appimage/dbs.tar.gz' diff --git a/bauh/gems/arch/__init__.py b/bauh/gems/arch/__init__.py index df9cf3cc..ba3b64ae 100644 --- a/bauh/gems/arch/__init__.py +++ b/bauh/gems/arch/__init__.py @@ -1,6 +1,6 @@ import os -from bauh.api.paths import CONFIG_PATH, TEMP_DIR, CACHE_PATH +from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_PATH from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -9,11 +9,11 @@ ARCH_CACHE_PATH = f'{CACHE_PATH}/arch' CATEGORIES_FILE_PATH = f'{ARCH_CACHE_PATH}/categories.txt' URL_CATEGORIES_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/categories.txt' URL_GPG_SERVERS = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/gpgservers.txt' -ARCH_CONFIG_DIR = f'{CONFIG_PATH}/arch' +ARCH_CONFIG_DIR = f'{CONFIG_DIR}/arch' CUSTOM_MAKEPKG_FILE = f'{ARCH_CONFIG_DIR}/makepkg.conf' AUR_INDEX_FILE = f'{ARCH_CACHE_PATH}/aur/index.txt' AUR_INDEX_TS_FILE = f'{ARCH_CACHE_PATH}/aur/index.ts' -CONFIG_FILE = f'{CONFIG_PATH}/arch.yml' +CONFIG_FILE = f'{CONFIG_DIR}/arch.yml' SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/aur_suggestions.txt' UPDATES_IGNORED_FILE = f'{ARCH_CONFIG_DIR}/updates_ignored.txt' EDITABLE_PKGBUILDS_FILE = f'{ARCH_CONFIG_DIR}/aur/editable_pkgbuilds.txt' diff --git a/bauh/gems/flatpak/__init__.py b/bauh/gems/flatpak/__init__.py index 2212e314..e6e18a35 100644 --- a/bauh/gems/flatpak/__init__.py +++ b/bauh/gems/flatpak/__init__.py @@ -3,13 +3,13 @@ from pathlib import Path from packaging.version import parse as parse_version -from bauh.api.paths import CONFIG_PATH +from bauh.api.paths import CONFIG_DIR from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/flatpak/suggestions.txt' -CONFIG_FILE = f'{CONFIG_PATH}/flatpak.yml' -FLATPAK_CONFIG_DIR = f'{CONFIG_PATH}/flatpak' +CONFIG_FILE = f'{CONFIG_DIR}/flatpak.yml' +FLATPAK_CONFIG_DIR = f'{CONFIG_DIR}/flatpak' UPDATES_IGNORED_FILE = f'{FLATPAK_CONFIG_DIR}/updates_ignored.txt' EXPORTS_PATH = '{}/.local/share/flatpak/exports/share'.format(str(Path.home())) VERSION_1_2 = parse_version('1.2') diff --git a/bauh/gems/snap/__init__.py b/bauh/gems/snap/__init__.py index d2356f43..d2d25497 100644 --- a/bauh/gems/snap/__init__.py +++ b/bauh/gems/snap/__init__.py @@ -1,11 +1,11 @@ import os -from bauh.api.paths import CONFIG_PATH, CACHE_PATH +from bauh.api.paths import CONFIG_DIR, CACHE_PATH from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) SNAP_CACHE_PATH = f'{CACHE_PATH}/snap' -CONFIG_FILE = f'{CONFIG_PATH}/snap.yml' +CONFIG_FILE = f'{CONFIG_DIR}/snap.yml' CATEGORIES_FILE_PATH = f'{SNAP_CACHE_PATH}/categories.txt' URL_CATEGORIES_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/snap/categories.txt' SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/snap/suggestions.txt' diff --git a/bauh/gems/web/__init__.py b/bauh/gems/web/__init__.py index 09458384..43e47df9 100644 --- a/bauh/gems/web/__init__.py +++ b/bauh/gems/web/__init__.py @@ -1,7 +1,7 @@ import os from pathlib import Path -from bauh.api.paths import DESKTOP_ENTRIES_DIR, CONFIG_PATH, TEMP_DIR, CACHE_PATH +from bauh.api.paths import DESKTOP_ENTRIES_DIR, CONFIG_DIR, TEMP_DIR, CACHE_PATH from bauh.commons import resource from bauh.commons.util import map_timestamp_file @@ -31,7 +31,7 @@ TEMP_PATH = f'{TEMP_DIR}/web' SEARCH_INDEX_FILE = f'{WEB_CACHE_PATH}/index.yml' SUGGESTIONS_CACHE_FILE = f'{WEB_CACHE_PATH}/suggestions.yml' SUGGESTIONS_CACHE_TS_FILE = map_timestamp_file(SUGGESTIONS_CACHE_FILE) -CONFIG_FILE = f'{CONFIG_PATH}/web.yml' +CONFIG_FILE = f'{CONFIG_DIR}/web.yml' ENVIRONMENT_SETTINGS_CACHED_FILE = f'{WEB_CACHE_PATH}/environment.yml' ENVIRONMENT_SETTINGS_TS_FILE = f'{WEB_CACHE_PATH}/environment.ts' NATIVEFIER_BASE_URL = 'https://github.com/nativefier/nativefier/archive/v{version}.tar.gz' diff --git a/bauh/view/util/util.py b/bauh/view/util/util.py index 6236fab3..8f126628 100644 --- a/bauh/view/util/util.py +++ b/bauh/view/util/util.py @@ -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 CONFIG_PATH, CACHE_PATH +from bauh.api.paths import CONFIG_DIR, CACHE_PATH from bauh.commons.system import run_cmd from bauh.view.util import resource @@ -61,7 +61,7 @@ def clean_app_files(managers: List[SoftwareManager], logs: bool = True): if logs: print('[bauh] Cleaning configuration and cache files') - for path in (CACHE_PATH, CONFIG_PATH): + for path in (CACHE_PATH, CONFIG_DIR): if logs: print('[bauh] Deleting directory {}'.format(path))