mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-28 22:01:24 +00:00
refactor!: restructure qt layout, untangle from backend (#1095)
* refactor: untangle backend and frontend files * refactor: more structure organizing * refactor: rename silent_subprocess.py * refactor: update qt ui structure to pure mvc + temporarily mixed * refactor: pluralize MVC folders
This commit is contained in:
committed by
GitHub
parent
fff967617b
commit
f49cb4fade
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.core.utils.dupe_files import DupeRegistry
|
||||
from tagstudio.core.library.alchemy.registries.dupe_files_registry import DupeFilesRegistry
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
@@ -30,7 +30,7 @@ def test_refresh_dupe_files(library: Library):
|
||||
|
||||
library.add_entries([entry, entry2])
|
||||
|
||||
registry = DupeRegistry(library=library)
|
||||
registry = DupeFilesRegistry(library=library)
|
||||
|
||||
dupe_file_path = CWD.parent / "fixtures" / "result.dupeguru"
|
||||
registry.refresh_dupe_files(dupe_file_path)
|
||||
@@ -3,7 +3,7 @@
|
||||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.qt.modals.folders_to_tags import folders_to_tags
|
||||
from tagstudio.qt.mixed.folders_to_tags import folders_to_tags
|
||||
|
||||
|
||||
def test_folders_to_tags(library: Library):
|
||||
|
||||
@@ -9,8 +9,8 @@ import pytest
|
||||
|
||||
from tagstudio.core.library.alchemy.enums import BrowsingState
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.registries.unlinked_registry import UnlinkedRegistry
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.core.utils.unlinked_registry import UnlinkedRegistry
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
|
||||
from tagstudio.core.enums import LibraryPrefs
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.utils.refresh_dir import RefreshDirTracker
|
||||
from tagstudio.core.library.refresh import RefreshTracker
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
@@ -22,7 +22,7 @@ def test_refresh_new_files(library: Library, exclude_mode: bool):
|
||||
# Given
|
||||
library.set_prefs(LibraryPrefs.IS_EXCLUDE_LIST, exclude_mode)
|
||||
library.set_prefs(LibraryPrefs.EXTENSION_LIST, [".md"])
|
||||
registry = RefreshDirTracker(library=library)
|
||||
registry = RefreshTracker(library=library)
|
||||
library.included_files.clear()
|
||||
(library_dir / "FOO.MD").touch()
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from pytestqt.qtbot import QtBot
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Tag, TagAlias
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.modals.build_tag import BuildTagPanel, CustomTableItem
|
||||
from tagstudio.qt.mixed.build_tag import BuildTagPanel, CustomTableItem
|
||||
from tagstudio.qt.translations import Translations
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry, Tag
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.controller.widgets.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.controllers.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ from tagstudio.core.enums import ShowFilepathOption
|
||||
from tagstudio.core.library.alchemy.library import Library, LibraryStatus
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.controller.widgets.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.modals.settings_panel import SettingsPanel
|
||||
from tagstudio.qt.controllers.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.mixed.settings_panel import SettingsPanel
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
from PySide6.QtCore import QRect
|
||||
from PySide6.QtWidgets import QPushButton, QWidget
|
||||
|
||||
from tagstudio.qt.flowlayout import FlowLayout
|
||||
from tagstudio.qt.views.layouts.flow_layout import FlowLayout
|
||||
|
||||
|
||||
def test_flow_layout_happy_path():
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.qt.modals.folders_to_tags import BranchData, generate_preview_data
|
||||
from tagstudio.qt.mixed.folders_to_tags import BranchData, generate_preview_data
|
||||
|
||||
|
||||
def test_generate_preview_data(library: Library, snapshot: BranchData):
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from tagstudio.core.global_settings import GlobalSettings, Theme
|
||||
from tagstudio.qt.global_settings import GlobalSettings, Theme
|
||||
|
||||
|
||||
def test_read_settings(library_dir: Path):
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import pytest
|
||||
|
||||
from tagstudio.core.library.alchemy.enums import ItemType
|
||||
from tagstudio.qt.mixed.item_thumb import BadgeType, ItemThumb
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
from tagstudio.qt.widgets.item_thumb import BadgeType, ItemThumb
|
||||
|
||||
|
||||
@pytest.mark.parametrize("new_value", (True, False))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.qt.controller.widgets.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.controllers.preview_panel_controller import PreviewPanel
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
from tagstudio.core.library.alchemy.enums import BrowsingState, ItemType
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.item_thumb import ItemThumb
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
from tagstudio.qt.widgets.item_thumb import ItemThumb
|
||||
|
||||
|
||||
def test_browsing_state_update(qt_driver: QtDriver):
|
||||
|
||||
@@ -7,7 +7,7 @@ from pytestqt.qtbot import QtBot
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Tag
|
||||
from tagstudio.qt.modals.build_tag import BuildTagPanel
|
||||
from tagstudio.qt.mixed.build_tag import BuildTagPanel
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
from pytestqt.qtbot import QtBot
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.qt.modals.tag_search import TagSearchPanel
|
||||
from tagstudio.qt.mixed.tag_search import TagSearchPanel
|
||||
|
||||
|
||||
def test_update_tags(qtbot: QtBot, library: Library):
|
||||
|
||||
@@ -9,8 +9,8 @@ from PySide6.QtCore import QSettings
|
||||
|
||||
from tagstudio.core.driver import DriverMixin
|
||||
from tagstudio.core.enums import SettingItems
|
||||
from tagstudio.core.global_settings import GlobalSettings
|
||||
from tagstudio.core.library.alchemy.library import LibraryStatus
|
||||
from tagstudio.qt.global_settings import GlobalSettings
|
||||
|
||||
|
||||
class TestDriver(DriverMixin):
|
||||
|
||||
@@ -7,7 +7,7 @@ from pathlib import Path
|
||||
from time import time
|
||||
|
||||
from tagstudio.core.enums import LibraryPrefs
|
||||
from tagstudio.qt.widgets.migration_modal import JsonMigrationModal
|
||||
from tagstudio.qt.mixed.migration_modal import JsonMigrationModal
|
||||
|
||||
CWD = Path(__file__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user