From 8f9810bd696a1e8e5a08c59f3e3f1af508729b5f Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 23 Nov 2021 17:53:05 -0300 Subject: [PATCH] [api] refactoring: 'constants' module renamed to 'paths' --- bauh/api/abstract/model.py | 2 +- bauh/api/{constants.py => paths.py} | 0 bauh/commons/config.py | 2 +- bauh/gems/appimage/__init__.py | 2 +- bauh/gems/arch/__init__.py | 2 +- bauh/gems/arch/controller.py | 2 +- bauh/gems/arch/database.py | 2 +- bauh/gems/arch/mirrors.py | 2 +- bauh/gems/flatpak/__init__.py | 2 +- bauh/gems/snap/__init__.py | 2 +- bauh/gems/web/__init__.py | 2 +- bauh/gems/web/controller.py | 2 +- bauh/stylesheet.py | 2 +- bauh/view/core/tray_client.py | 2 +- bauh/view/core/update.py | 2 +- bauh/view/util/util.py | 2 +- 16 files changed, 15 insertions(+), 15 deletions(-) rename bauh/api/{constants.py => paths.py} (100%) diff --git a/bauh/api/abstract/model.py b/bauh/api/abstract/model.py index e569ee6e..95354bd9 100644 --- a/bauh/api/abstract/model.py +++ b/bauh/api/abstract/model.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from enum import Enum from typing import List, Optional -from bauh.api.constants import CACHE_PATH +from bauh.api.paths import CACHE_PATH class CustomSoftwareAction: diff --git a/bauh/api/constants.py b/bauh/api/paths.py similarity index 100% rename from bauh/api/constants.py rename to bauh/api/paths.py diff --git a/bauh/commons/config.py b/bauh/commons/config.py index dcb42638..300f58d5 100644 --- a/bauh/commons/config.py +++ b/bauh/commons/config.py @@ -7,7 +7,7 @@ from typing import Optional import yaml -from bauh.api.constants import CONFIG_PATH +from bauh.api.paths import CONFIG_PATH from bauh.commons import util diff --git a/bauh/gems/appimage/__init__.py b/bauh/gems/appimage/__init__.py index 3ecbc8c9..06868e5b 100644 --- a/bauh/gems/appimage/__init__.py +++ b/bauh/gems/appimage/__init__.py @@ -2,7 +2,7 @@ import os from pathlib import Path from typing import Optional -from bauh.api.constants import CONFIG_PATH, CACHE_PATH, TEMP_DIR +from bauh.api.paths import CONFIG_PATH, CACHE_PATH, TEMP_DIR from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/bauh/gems/arch/__init__.py b/bauh/gems/arch/__init__.py index 22fcb91f..425762d5 100644 --- a/bauh/gems/arch/__init__.py +++ b/bauh/gems/arch/__init__.py @@ -1,7 +1,7 @@ import os from pathlib import Path -from bauh.api.constants import CACHE_PATH, CONFIG_PATH, TEMP_DIR +from bauh.api.paths import CACHE_PATH, CONFIG_PATH, TEMP_DIR from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 4cbcd2b3..8c29b579 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -25,7 +25,7 @@ from bauh.api.abstract.model import PackageUpdate, PackageHistory, SoftwarePacka from bauh.api.abstract.view import MessageType, FormComponent, InputOption, SingleSelectComponent, SelectViewType, \ ViewComponent, PanelComponent, MultipleSelectComponent, TextInputComponent, TextInputType, \ FileChooserComponent, TextComponent -from bauh.api.constants import TEMP_DIR +from bauh.api.paths import TEMP_DIR from bauh.api.exception import NoInternetException from bauh.commons import user, system from bauh.commons.boot import CreateConfigFile diff --git a/bauh/gems/arch/database.py b/bauh/gems/arch/database.py index b07b8a61..cb5094ba 100644 --- a/bauh/gems/arch/database.py +++ b/bauh/gems/arch/database.py @@ -7,7 +7,7 @@ from logging import Logger from pathlib import Path from typing import Optional -from bauh.api.constants import CACHE_PATH +from bauh.api.paths import CACHE_PATH from bauh.commons.system import ProcessHandler SYNC_FILE = '{}/arch/db_sync'.format(CACHE_PATH) diff --git a/bauh/gems/arch/mirrors.py b/bauh/gems/arch/mirrors.py index 98cc0a19..64d964e3 100644 --- a/bauh/gems/arch/mirrors.py +++ b/bauh/gems/arch/mirrors.py @@ -6,7 +6,7 @@ from datetime import datetime from logging import Logger from pathlib import Path -from bauh.api.constants import CACHE_PATH +from bauh.api.paths import CACHE_PATH SYNC_FILE = '{}/arch/mirrors_sync'.format(CACHE_PATH) diff --git a/bauh/gems/flatpak/__init__.py b/bauh/gems/flatpak/__init__.py index 4c1839dd..3c3520ad 100644 --- a/bauh/gems/flatpak/__init__.py +++ b/bauh/gems/flatpak/__init__.py @@ -3,7 +3,7 @@ from pathlib import Path from packaging.version import parse as parse_version -from bauh.api.constants import CONFIG_PATH +from bauh.api.paths import CONFIG_PATH from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/bauh/gems/snap/__init__.py b/bauh/gems/snap/__init__.py index 0a3521c2..b8d47785 100644 --- a/bauh/gems/snap/__init__.py +++ b/bauh/gems/snap/__init__.py @@ -1,6 +1,6 @@ import os -from bauh.api.constants import CACHE_PATH, CONFIG_PATH +from bauh.api.paths import CACHE_PATH, CONFIG_PATH from bauh.commons import resource ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/bauh/gems/web/__init__.py b/bauh/gems/web/__init__.py index 331f2e23..d7494619 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.constants import DESKTOP_ENTRIES_DIR, CONFIG_PATH, TEMP_DIR, CACHE_PATH +from bauh.api.paths import DESKTOP_ENTRIES_DIR, CONFIG_PATH, TEMP_DIR, CACHE_PATH from bauh.commons import resource from bauh.commons.util import map_timestamp_file diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index 8971a1f6..069551c9 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -26,7 +26,7 @@ from bauh.api.abstract.model import SoftwarePackage, CustomSoftwareAction, Packa SuggestionPriority, PackageStatus from bauh.api.abstract.view import MessageType, MultipleSelectComponent, InputOption, SingleSelectComponent, \ SelectViewType, TextInputComponent, FormComponent, FileChooserComponent, ViewComponent, PanelComponent -from bauh.api.constants import DESKTOP_ENTRIES_DIR +from bauh.api.paths import DESKTOP_ENTRIES_DIR from bauh.commons import resource from bauh.commons.boot import CreateConfigFile from bauh.commons.html import bold diff --git a/bauh/stylesheet.py b/bauh/stylesheet.py index 4942754e..445ff9ba 100644 --- a/bauh/stylesheet.py +++ b/bauh/stylesheet.py @@ -3,7 +3,7 @@ import os import re from typing import Optional, Dict, Tuple, Set -from bauh.api.constants import USER_THEMES_PATH +from bauh.api.paths import USER_THEMES_PATH from bauh.view.util import resource from bauh.view.util.translation import I18n diff --git a/bauh/view/core/tray_client.py b/bauh/view/core/tray_client.py index 340174b0..0fbe2daf 100644 --- a/bauh/view/core/tray_client.py +++ b/bauh/view/core/tray_client.py @@ -1,6 +1,6 @@ from pathlib import Path -from bauh.api.constants import CACHE_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 diff --git a/bauh/view/core/update.py b/bauh/view/core/update.py index 7b69bcd7..d8532dbd 100644 --- a/bauh/view/core/update.py +++ b/bauh/view/core/update.py @@ -5,7 +5,7 @@ from pathlib import Path from packaging.version import parse as parse_version from bauh import __app_name__, __version__ -from bauh.api.constants import CACHE_PATH +from bauh.api.paths import CACHE_PATH from bauh.api.http import HttpClient from bauh.commons.html import bold, link from bauh.view.util.translation import I18n diff --git a/bauh/view/util/util.py b/bauh/view/util/util.py index 333716da..88a877bc 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.constants import CACHE_PATH, CONFIG_PATH +from bauh.api.paths import CACHE_PATH, CONFIG_PATH from bauh.commons.system import run_cmd from bauh.view.util import resource