mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-31 23:29:10 +00:00
Refactor: remove __init__.py files meant for Python versions before 3.3 (#160)
* Refactor: remove __init__ meant for Python versions before 3.3 This does mess with a large amount of imports, as the system was being misused to re-export submodules. This change is necessary if PyInstaller is to work at all. * Thanks Ruff Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> --------- Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
from .file_opener import open_file, FileOpenerHelper, FileOpenerLabel
|
||||
from .function_iterator import FunctionIterator
|
||||
from .custom_runnable import CustomRunnable
|
||||
@@ -1,11 +0,0 @@
|
||||
from .tag_search import TagSearchPanel
|
||||
from .build_tag import BuildTagPanel
|
||||
from .tag_database import TagDatabasePanel
|
||||
from .add_field import AddFieldModal
|
||||
from .file_extension import FileExtensionModal
|
||||
from .delete_unlinked import DeleteUnlinkedEntriesModal
|
||||
from .relink_unlinked import RelinkUnlinkedEntries
|
||||
from .fix_unlinked import FixUnlinkedEntriesModal
|
||||
from .mirror_entities import MirrorEntriesModal
|
||||
from .fix_dupes import FixDupeFilesModal
|
||||
from .folders_to_tags import FoldersToTagsModal
|
||||
@@ -21,8 +21,9 @@ from PySide6.QtWidgets import (
|
||||
from src.core.library import Library, Tag
|
||||
from src.core.palette import ColorType, get_tag_color
|
||||
from src.core.ts_core import TAG_COLORS
|
||||
from src.qt.widgets import PanelWidget, PanelModal, TagWidget
|
||||
from src.qt.modals import TagSearchPanel
|
||||
from src.qt.widgets.panel import PanelWidget, PanelModal
|
||||
from src.qt.widgets.tag import TagWidget
|
||||
from src.qt.modals.tag_search import TagSearchPanel
|
||||
|
||||
|
||||
ERROR = f"[ERROR]"
|
||||
|
||||
@@ -16,8 +16,9 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from src.core.library import ItemType, Library
|
||||
from src.qt.helpers import CustomRunnable, FunctionIterator
|
||||
from src.qt.widgets import ProgressWidget
|
||||
from src.qt.helpers.custom_runnable import CustomRunnable
|
||||
from src.qt.helpers.function_iterator import FunctionIterator
|
||||
from src.qt.widgets.progress import ProgressWidget
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -7,7 +7,7 @@ from PySide6.QtCore import Signal, Qt
|
||||
from PySide6.QtWidgets import QVBoxLayout, QPushButton, QTableWidget, QTableWidgetItem
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.widgets import PanelWidget
|
||||
from src.qt.widgets.panel import PanelWidget
|
||||
|
||||
|
||||
class FileExtensionModal(PanelWidget):
|
||||
|
||||
@@ -17,7 +17,7 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.modals import MirrorEntriesModal
|
||||
from src.qt.modals.mirror_entities import MirrorEntriesModal
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -10,9 +10,11 @@ from PySide6.QtCore import QThread, Qt, QThreadPool
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.helpers import FunctionIterator, CustomRunnable
|
||||
from src.qt.modals import DeleteUnlinkedEntriesModal, RelinkUnlinkedEntries
|
||||
from src.qt.widgets import ProgressWidget
|
||||
from src.qt.helpers.function_iterator import FunctionIterator
|
||||
from src.qt.helpers.custom_runnable import CustomRunnable
|
||||
from src.qt.modals.delete_unlinked import DeleteUnlinkedEntriesModal
|
||||
from src.qt.modals.relink_unlinked import RelinkUnlinkedEntries
|
||||
from src.qt.widgets.progress import ProgressWidget
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -18,8 +18,9 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.helpers import FunctionIterator, CustomRunnable
|
||||
from src.qt.widgets import ProgressWidget
|
||||
from src.qt.helpers.function_iterator import FunctionIterator
|
||||
from src.qt.helpers.custom_runnable import CustomRunnable
|
||||
from src.qt.widgets.progress import ProgressWidget
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -7,8 +7,9 @@ import typing
|
||||
from PySide6.QtCore import QObject, Signal, QThreadPool
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.helpers import FunctionIterator, CustomRunnable
|
||||
from src.qt.widgets import ProgressWidget
|
||||
from src.qt.helpers.function_iterator import FunctionIterator
|
||||
from src.qt.helpers.custom_runnable import CustomRunnable
|
||||
from src.qt.widgets.progress import ProgressWidget
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -13,8 +13,9 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from src.core.library import Library
|
||||
from src.qt.widgets import PanelWidget, PanelModal, TagWidget
|
||||
from src.qt.modals import BuildTagPanel
|
||||
from src.qt.widgets.panel import PanelWidget, PanelModal
|
||||
from src.qt.widgets.tag import TagWidget
|
||||
from src.qt.modals.build_tag import BuildTagPanel
|
||||
|
||||
|
||||
class TagDatabasePanel(PanelWidget):
|
||||
|
||||
@@ -19,7 +19,8 @@ from PySide6.QtWidgets import (
|
||||
|
||||
from src.core.library import Library
|
||||
from src.core.palette import ColorType, get_tag_color
|
||||
from src.qt.widgets import PanelWidget, TagWidget
|
||||
from src.qt.widgets.panel import PanelWidget
|
||||
from src.qt.widgets.tag import TagWidget
|
||||
|
||||
|
||||
ERROR = f"[ERROR]"
|
||||
|
||||
@@ -74,24 +74,20 @@ from src.core.ts_core import (
|
||||
from src.core.utils.web import strip_web_protocol
|
||||
from src.qt.flowlayout import FlowLayout
|
||||
from src.qt.main_window import Ui_MainWindow
|
||||
from src.qt.helpers import FunctionIterator, CustomRunnable
|
||||
from src.qt.widgets import (
|
||||
CollageIconRenderer,
|
||||
ThumbRenderer,
|
||||
PanelModal,
|
||||
ProgressWidget,
|
||||
PreviewPanel,
|
||||
ItemThumb,
|
||||
)
|
||||
from src.qt.modals import (
|
||||
BuildTagPanel,
|
||||
TagDatabasePanel,
|
||||
FileExtensionModal,
|
||||
FixUnlinkedEntriesModal,
|
||||
FixDupeFilesModal,
|
||||
FoldersToTagsModal,
|
||||
)
|
||||
|
||||
from src.qt.helpers.function_iterator import FunctionIterator
|
||||
from src.qt.helpers.custom_runnable import CustomRunnable
|
||||
from src.qt.widgets.collage_icon import CollageIconRenderer
|
||||
from src.qt.widgets.panel import PanelModal
|
||||
from src.qt.widgets.thumb_renderer import ThumbRenderer
|
||||
from src.qt.widgets.progress import ProgressWidget
|
||||
from src.qt.widgets.preview_panel import PreviewPanel
|
||||
from src.qt.widgets.item_thumb import ItemThumb
|
||||
from src.qt.modals.build_tag import BuildTagPanel
|
||||
from src.qt.modals.tag_database import TagDatabasePanel
|
||||
from src.qt.modals.file_extension import FileExtensionModal
|
||||
from src.qt.modals.fix_unlinked import FixUnlinkedEntriesModal
|
||||
from src.qt.modals.fix_dupes import FixDupeFilesModal
|
||||
from src.qt.modals.folders_to_tags import FoldersToTagsModal
|
||||
import src.qt.resources_rc
|
||||
|
||||
# SIGQUIT is not defined on Windows
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
from .fields import FieldContainer, FieldWidget
|
||||
from .collage_icon import CollageIconRenderer
|
||||
from .thumb_button import ThumbButton
|
||||
from .thumb_renderer import ThumbRenderer
|
||||
from .panel import PanelWidget, PanelModal
|
||||
from .text_box_edit import EditTextBox
|
||||
from .text_line_edit import EditTextLine
|
||||
from .progress import ProgressWidget
|
||||
from .tag import TagWidget
|
||||
from .tag_box import TagBoxWidget
|
||||
from .text import TextWidget
|
||||
from .item_thumb import ItemThumb
|
||||
from .preview_panel import PreviewPanel
|
||||
@@ -26,11 +26,12 @@ from PySide6.QtWidgets import (
|
||||
from src.core.library import ItemType, Library, Entry
|
||||
from src.core.ts_core import AUDIO_TYPES, VIDEO_TYPES, IMAGE_TYPES
|
||||
from src.qt.flowlayout import FlowWidget
|
||||
from src.qt.helpers import FileOpenerHelper
|
||||
from src.qt.widgets import ThumbRenderer, ThumbButton
|
||||
from src.qt.helpers.file_opener import FileOpenerHelper
|
||||
from src.qt.widgets.thumb_renderer import ThumbRenderer
|
||||
from src.qt.widgets.thumb_button import ThumbButton
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from src.qt.widgets import PreviewPanel
|
||||
from src.qt.widgets.preview_panel import PreviewPanel
|
||||
|
||||
ERROR = f"[ERROR]"
|
||||
WARNING = f"[WARNING]"
|
||||
|
||||
@@ -29,18 +29,16 @@ from humanfriendly import format_size
|
||||
|
||||
from src.core.library import Entry, ItemType, Library
|
||||
from src.core.ts_core import VIDEO_TYPES, IMAGE_TYPES
|
||||
from src.qt.helpers import FileOpenerLabel, FileOpenerHelper, open_file
|
||||
from src.qt.modals import AddFieldModal
|
||||
from src.qt.widgets import (
|
||||
ThumbRenderer,
|
||||
FieldContainer,
|
||||
TagBoxWidget,
|
||||
TextWidget,
|
||||
PanelModal,
|
||||
EditTextBox,
|
||||
EditTextLine,
|
||||
ItemThumb,
|
||||
)
|
||||
from src.qt.helpers.file_opener import FileOpenerLabel, FileOpenerHelper, open_file
|
||||
from src.qt.modals.add_field import AddFieldModal
|
||||
from src.qt.widgets.thumb_renderer import ThumbRenderer
|
||||
from src.qt.widgets.fields import FieldContainer
|
||||
from src.qt.widgets.tag_box import TagBoxWidget
|
||||
from src.qt.widgets.text import TextWidget
|
||||
from src.qt.widgets.panel import PanelModal
|
||||
from src.qt.widgets.text_box_edit import EditTextBox
|
||||
from src.qt.widgets.text_line_edit import EditTextLine
|
||||
from src.qt.widgets.item_thumb import ItemThumb
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -12,8 +12,11 @@ from PySide6.QtWidgets import QPushButton
|
||||
|
||||
from src.core.library import Library, Tag
|
||||
from src.qt.flowlayout import FlowLayout
|
||||
from src.qt.widgets import FieldWidget, TagWidget, PanelModal
|
||||
from src.qt.modals import BuildTagPanel, TagSearchPanel
|
||||
from src.qt.widgets.fields import FieldWidget
|
||||
from src.qt.widgets.tag import TagWidget
|
||||
from src.qt.widgets.panel import PanelModal
|
||||
from src.qt.modals.build_tag import BuildTagPanel
|
||||
from src.qt.modals.tag_search import TagSearchPanel
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QHBoxLayout, QLabel
|
||||
from src.qt.widgets import FieldWidget
|
||||
from src.qt.widgets.fields import FieldWidget
|
||||
|
||||
|
||||
class TextWidget(FieldWidget):
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
from PySide6.QtWidgets import QVBoxLayout, QPlainTextEdit
|
||||
|
||||
from src.qt.widgets import PanelWidget
|
||||
from src.qt.widgets.panel import PanelWidget
|
||||
|
||||
|
||||
class EditTextBox(PanelWidget):
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Callable
|
||||
|
||||
from PySide6.QtWidgets import QVBoxLayout, QLineEdit
|
||||
|
||||
from src.qt.widgets import PanelWidget
|
||||
from src.qt.widgets.panel import PanelWidget
|
||||
|
||||
|
||||
class EditTextLine(PanelWidget):
|
||||
|
||||
Reference in New Issue
Block a user