diff --git a/bauh/view/core/config.py b/bauh/view/core/config.py index 2b2c5ee4..fef5bada 100644 --- a/bauh/view/core/config.py +++ b/bauh/view/core/config.py @@ -1,76 +1 @@ -from bauh.api.paths import CONFIG_DIR -from bauh.commons.config import YAMLConfigManager - -FILE_PATH = f'{CONFIG_DIR}/config.yml' - -BACKUP_DEFAULT_REMOVE_METHOD = 'self' -BACKUP_REMOVE_METHODS = {BACKUP_DEFAULT_REMOVE_METHOD, 'all'} - - -class CoreConfigManager(YAMLConfigManager): - - def __init__(self): - super(CoreConfigManager, self).__init__(config_file_path=FILE_PATH) - - def get_default_config(self) -> dict: - return { - 'gems': None, - 'memory_cache': { - 'data_expiration': 60 * 60, - 'icon_expiration': 60 * 5 - }, - 'locale': None, - 'updates': { - 'check_interval': 5, - 'ask_for_reboot': True - }, - 'system': { - 'notifications': True, - 'single_dependency_checking': False - }, - 'suggestions': { - 'enabled': True, - 'by_type': 15 - }, - 'ui': { - 'table': { - 'max_displayed': 50 - }, - 'tray': { - 'default_icon': None, - 'updates_icon': None - }, - 'qt_style': 'fusion', - 'hdpi': True, - "auto_scale": False, - "scale_factor": 1.0, - 'theme': 'light', - 'system_theme': False - - }, - 'download': { - 'multithreaded': False, - 'multithreaded_client': None, - 'icons': True, - 'check_ssl': True - }, - 'store_root_password': True, - 'disk': { - 'trim': { - 'after_upgrade': False - } - }, - 'backup': { - 'enabled': True, - 'install': None, - 'uninstall': None, - 'downgrade': None, - 'upgrade': None, - 'mode': 'incremental', - 'type': 'rsync', - 'remove_method': 'self' - }, - 'boot': { - 'load_apps': True - } - } +from bearhub.view.core.config import * # noqa: F401,F403 diff --git a/bearhub/app_main.py b/bearhub/app_main.py index 2235266f..38f865cf 100644 --- a/bearhub/app_main.py +++ b/bearhub/app_main.py @@ -9,7 +9,7 @@ from PyQt5.QtCore import QCoreApplication, Qt from bearhub import __app_name__ from bearhub import app_args -from bauh.view.core.config import CoreConfigManager +from bearhub.view.core.config import CoreConfigManager from bauh.view.util import logs diff --git a/bearhub/cli/app_main.py b/bearhub/cli/app_main.py index 7b0585c8..f2df291f 100644 --- a/bearhub/cli/app_main.py +++ b/bearhub/cli/app_main.py @@ -11,7 +11,7 @@ from bearhub.cli.controller import CLIManager from bauh.commons.internet import InternetChecker from bearhub.context import generate_i18n, DEFAULT_I18N_KEY from bauh.view.core import gems -from bauh.view.core.config import CoreConfigManager +from bearhub.view.core.config import CoreConfigManager from bauh.view.core.controller import GenericSoftwareManager from bauh.view.core.downloader import AdaptableFileDownloader from bauh.view.util import logs, util, resource diff --git a/bearhub/view/__init__.py b/bearhub/view/__init__.py new file mode 100644 index 00000000..355ca5e2 --- /dev/null +++ b/bearhub/view/__init__.py @@ -0,0 +1,3 @@ +""" +Bearhub view namespace package (migration in progress). +""" diff --git a/bearhub/view/core/__init__.py b/bearhub/view/core/__init__.py new file mode 100644 index 00000000..c88ff18f --- /dev/null +++ b/bearhub/view/core/__init__.py @@ -0,0 +1,3 @@ +""" +Bearhub view.core namespace package (migration in progress). +""" diff --git a/bearhub/view/core/config.py b/bearhub/view/core/config.py new file mode 100644 index 00000000..2b2c5ee4 --- /dev/null +++ b/bearhub/view/core/config.py @@ -0,0 +1,76 @@ +from bauh.api.paths import CONFIG_DIR +from bauh.commons.config import YAMLConfigManager + +FILE_PATH = f'{CONFIG_DIR}/config.yml' + +BACKUP_DEFAULT_REMOVE_METHOD = 'self' +BACKUP_REMOVE_METHODS = {BACKUP_DEFAULT_REMOVE_METHOD, 'all'} + + +class CoreConfigManager(YAMLConfigManager): + + def __init__(self): + super(CoreConfigManager, self).__init__(config_file_path=FILE_PATH) + + def get_default_config(self) -> dict: + return { + 'gems': None, + 'memory_cache': { + 'data_expiration': 60 * 60, + 'icon_expiration': 60 * 5 + }, + 'locale': None, + 'updates': { + 'check_interval': 5, + 'ask_for_reboot': True + }, + 'system': { + 'notifications': True, + 'single_dependency_checking': False + }, + 'suggestions': { + 'enabled': True, + 'by_type': 15 + }, + 'ui': { + 'table': { + 'max_displayed': 50 + }, + 'tray': { + 'default_icon': None, + 'updates_icon': None + }, + 'qt_style': 'fusion', + 'hdpi': True, + "auto_scale": False, + "scale_factor": 1.0, + 'theme': 'light', + 'system_theme': False + + }, + 'download': { + 'multithreaded': False, + 'multithreaded_client': None, + 'icons': True, + 'check_ssl': True + }, + 'store_root_password': True, + 'disk': { + 'trim': { + 'after_upgrade': False + } + }, + 'backup': { + 'enabled': True, + 'install': None, + 'uninstall': None, + 'downgrade': None, + 'upgrade': None, + 'mode': 'incremental', + 'type': 'rsync', + 'remove_method': 'self' + }, + 'boot': { + 'load_apps': True + } + }