[api] refactoring: 'constants' module renamed to 'paths'

This commit is contained in:
Vinicius Moreira
2021-11-23 17:53:05 -03:00
parent 70073a7bad
commit 8f9810bd69
16 changed files with 15 additions and 15 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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__))

View File

@@ -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__))

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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__))

View File

@@ -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__))

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

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.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