diff --git a/hpyc_cli/__main__.py b/hpyc_cli/__main__.py index 45d3b8b..7e56599 100644 --- a/hpyc_cli/__main__.py +++ b/hpyc_cli/__main__.py @@ -1,6 +1,7 @@ -from hpyc_core import Core import os +from hpyc_core import Core + VERSION = "V1.0.1" yes = ("y", "Y", "YES", "Yes", "yes", "true", "True", "是", "确认") instance_core = Core() diff --git a/hpyc_core/hpyc_core/__init__.py b/hpyc_core/hpyc_core/__init__.py index 751f781..f417073 100644 --- a/hpyc_core/hpyc_core/__init__.py +++ b/hpyc_core/hpyc_core/__init__.py @@ -1,18 +1,18 @@ """创建core""" -import os -import sys import atexit import importlib +import os +import sys from queue import Queue -from typing import Optional, Any from types import ModuleType +from typing import Any, Optional from hpyculator import _message_queue from hpyculator.hpysettings import SettingsFileObject # 类型标志用 +from ._calculate import CalculationManager from ._plugin import instance_plugin_manager # 插件管理 from ._settings import hpysettings -from ._calculate import CalculationManager from .data_structure import MetadataDict # _instance_settings_file: Optional[SettingsFileObject] = None diff --git a/hpyc_core/hpyc_core/_calculate/calculate_manager.py b/hpyc_core/hpyc_core/_calculate/calculate_manager.py index d93f612..8ca62f6 100644 --- a/hpyc_core/hpyc_core/_calculate/calculate_manager.py +++ b/hpyc_core/hpyc_core/_calculate/calculate_manager.py @@ -11,8 +11,8 @@ import hpyculator as hpyc from .. import _message_queue -from ..data_structure import MetadataDict from .._plugin import instance_plugin_manager +from ..data_structure import MetadataDict class CalculationManager: diff --git a/hpyc_core/hpyc_core/_data_structure/__init__.py b/hpyc_core/hpyc_core/_data_structure/__init__.py index 441fa81..256d386 100644 --- a/hpyc_core/hpyc_core/_data_structure/__init__.py +++ b/hpyc_core/hpyc_core/_data_structure/__init__.py @@ -1,4 +1,5 @@ -from typing import TypedDict, Literal +from typing import Literal, TypedDict + import hpyculator as hpyc diff --git a/hpyc_core/hpyc_core/_plugin/plugin_manager.py b/hpyc_core/hpyc_core/_plugin/plugin_manager.py index 0a160b6..4a772a8 100644 --- a/hpyc_core/hpyc_core/_plugin/plugin_manager.py +++ b/hpyc_core/hpyc_core/_plugin/plugin_manager.py @@ -3,7 +3,7 @@ import sys import traceback from types import ModuleType -from typing import Generator, Any +from typing import Any, Generator import hpyculator as hpyc diff --git a/hpyc_pyside_ui/Plugin/pluperfect_digital_invariant_hz.py b/hpyc_pyside_ui/Plugin/pluperfect_digital_invariant_hz.py index b822f53..9fc6b0c 100644 --- a/hpyc_pyside_ui/Plugin/pluperfect_digital_invariant_hz.py +++ b/hpyc_pyside_ui/Plugin/pluperfect_digital_invariant_hz.py @@ -1,6 +1,7 @@ -import hpyculator as hpyc -from typing import Generator import math +from typing import Generator + +import hpyculator as hpyc NAME = "自幂数计算" AUTHOR = "HowieHz" or ["HowieHz", ""] diff --git a/hpyc_pyside_ui/Plugin/statistics_hz.py b/hpyc_pyside_ui/Plugin/statistics_hz.py index b34218a..2ba3fd8 100644 --- a/hpyc_pyside_ui/Plugin/statistics_hz.py +++ b/hpyc_pyside_ui/Plugin/statistics_hz.py @@ -1,6 +1,7 @@ -import hpyculator as hpyc import statistics as st +import hpyculator as hpyc + VERSION = "V1.2.1" PLUGIN_METADATA = { "input_mode": hpyc.STRING, diff --git a/hpyc_pyside_ui/__main__.py b/hpyc_pyside_ui/__main__.py index f66206d..104adb6 100644 --- a/hpyc_pyside_ui/__main__.py +++ b/hpyc_pyside_ui/__main__.py @@ -5,7 +5,6 @@ import sys from PySide6.QtWidgets import QApplication - from utils import CreateApp if __name__ == "__main__": diff --git a/hpyc_pyside_ui/utils/__init__.py b/hpyc_pyside_ui/utils/__init__.py index 8e6bfa3..30bb637 100644 --- a/hpyc_pyside_ui/utils/__init__.py +++ b/hpyc_pyside_ui/utils/__init__.py @@ -1,5 +1,6 @@ """运行主程序和主程序的一些初始化""" import os + from .ui_manager import MainWinApp # 窗口管理类(用于管理设置的窗口) from .var import instance_core diff --git a/hpyc_pyside_ui/utils/ui/about_win.py b/hpyc_pyside_ui/utils/ui/about_win.py index 945c4bd..510d287 100644 --- a/hpyc_pyside_ui/utils/ui/about_win.py +++ b/hpyc_pyside_ui/utils/ui/about_win.py @@ -8,51 +8,16 @@ # WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import ( - QCoreApplication, - QDate, - QDateTime, - QLocale, - QMetaObject, - QObject, - QPoint, - QRect, - QSize, - Qt, - QTime, - QUrl, -) -from PySide6.QtGui import ( - QBrush, - QColor, - QConicalGradient, - QCursor, - QFont, - QFontDatabase, - QGradient, - QIcon, - QImage, - QKeySequence, - QLinearGradient, - QPainter, - QPalette, - QPixmap, - QRadialGradient, - QTransform, -) -from PySide6.QtWidgets import ( - QApplication, - QComboBox, - QDialog, - QGridLayout, - QHBoxLayout, - QLabel, - QPushButton, - QSizePolicy, - QSpacerItem, - QTextBrowser, - QWidget, -) +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, QSize, Qt, + QTime, QUrl) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, + QFontDatabase, QGradient, QIcon, QImage, + QKeySequence, QLinearGradient, QPainter, QPalette, + QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QComboBox, QDialog, QGridLayout, + QHBoxLayout, QLabel, QPushButton, QSizePolicy, + QSpacerItem, QTextBrowser, QWidget) class Ui_AboutWin(object): diff --git a/hpyc_pyside_ui/utils/ui/main_win.py b/hpyc_pyside_ui/utils/ui/main_win.py index 048b18e..8d55fad 100644 --- a/hpyc_pyside_ui/utils/ui/main_win.py +++ b/hpyc_pyside_ui/utils/ui/main_win.py @@ -8,54 +8,18 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import ( - QCoreApplication, - QDate, - QDateTime, - QLocale, - QMetaObject, - QObject, - QPoint, - QRect, - QSize, - QTime, - QUrl, - Qt, -) -from PySide6.QtGui import ( - QBrush, - QColor, - QConicalGradient, - QCursor, - QFont, - QFontDatabase, - QGradient, - QIcon, - QImage, - QKeySequence, - QLinearGradient, - QPainter, - QPalette, - QPixmap, - QRadialGradient, - QTransform, -) -from PySide6.QtWidgets import ( - QApplication, - QCheckBox, - QFrame, - QGridLayout, - QHBoxLayout, - QLabel, - QListWidget, - QListWidgetItem, - QPlainTextEdit, - QPushButton, - QSizePolicy, - QSpacerItem, - QVBoxLayout, - QWidget, -) +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, QSize, Qt, + QTime, QUrl) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, + QFontDatabase, QGradient, QIcon, QImage, + QKeySequence, QLinearGradient, QPainter, QPalette, + QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QFrame, QGridLayout, + QHBoxLayout, QLabel, QListWidget, + QListWidgetItem, QPlainTextEdit, QPushButton, + QSizePolicy, QSpacerItem, QVBoxLayout, QWidget) + from . import main_window_resource_rc diff --git a/hpyc_pyside_ui/utils/ui/settings_win.py b/hpyc_pyside_ui/utils/ui/settings_win.py index 49c25a4..3428a57 100644 --- a/hpyc_pyside_ui/utils/ui/settings_win.py +++ b/hpyc_pyside_ui/utils/ui/settings_win.py @@ -8,50 +8,16 @@ # WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import ( - QCoreApplication, - QDate, - QDateTime, - QLocale, - QMetaObject, - QObject, - QPoint, - QRect, - QSize, - Qt, - QTime, - QUrl, -) -from PySide6.QtGui import ( - QBrush, - QColor, - QConicalGradient, - QCursor, - QFont, - QFontDatabase, - QGradient, - QIcon, - QImage, - QKeySequence, - QLinearGradient, - QPainter, - QPalette, - QPixmap, - QRadialGradient, - QTransform, -) -from PySide6.QtWidgets import ( - QApplication, - QCheckBox, - QComboBox, - QDialog, - QHBoxLayout, - QLabel, - QPushButton, - QSizePolicy, - QTextEdit, - QWidget, -) +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, QSize, Qt, + QTime, QUrl) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, + QFontDatabase, QGradient, QIcon, QImage, + QKeySequence, QLinearGradient, QPainter, QPalette, + QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDialog, + QHBoxLayout, QLabel, QPushButton, QSizePolicy, + QTextEdit, QWidget) class Ui_SettingsWin(object): diff --git a/hpyc_pyside_ui/utils/ui_manager/main_win_manager.py b/hpyc_pyside_ui/utils/ui_manager/main_win_manager.py index 31d63e0..8e3aada 100644 --- a/hpyc_pyside_ui/utils/ui_manager/main_win_manager.py +++ b/hpyc_pyside_ui/utils/ui_manager/main_win_manager.py @@ -2,22 +2,23 @@ import pathlib import time from dataclasses import dataclass -from typing import Any, Optional from queue import Queue from threading import Thread +from typing import Any, Optional import hpyculator as hpyc from hpyculator import SettingsFileObject from PySide6.QtCore import Qt -from PySide6.QtGui import QBrush, QGuiApplication, QPalette, QPixmap, QTextCursor +from PySide6.QtGui import (QBrush, QGuiApplication, QPalette, QPixmap, + QTextCursor) +from qframelesswindow import FramelessWindow -from .signal import instance_main_win_signal -from .about_win_manager import AboutWinApp -from .settings_win_manager import SettingsWinApp # 窗口管理类(用于管理设置的窗口) from .. import document as doc -from ..var import instance_core -from qframelesswindow import FramelessWindow from ..ui import Ui_MainWin +from ..var import instance_core +from .about_win_manager import AboutWinApp +from .settings_win_manager import SettingsWinApp # 窗口管理类(用于管理设置的窗口) +from .signal import instance_main_win_signal @dataclass