From 467bf48ffb2b78b6d27acb3768cd9a475cbb5918 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Wed, 22 Jan 2025 12:48:50 +0100 Subject: [PATCH] Change from pyqt to to pyside --- poetry.lock | 108 +++++++++++++++++++++++----------------------- pyproject.toml | 6 +-- syng/gui.py | 30 +++++++------ syng/resources.py | 2 +- 4 files changed, 74 insertions(+), 72 deletions(-) diff --git a/poetry.lock b/poetry.lock index cd231e0..74b5ed0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -1324,69 +1324,56 @@ files = [ ] [[package]] -name = "pyqt6" -version = "6.7.1" -description = "Python bindings for the Qt cross platform application toolkit" -optional = true -python-versions = ">=3.8" +name = "pyside6" +version = "6.8.1.1" +description = "Python bindings for the Qt cross-platform application and UI framework" +optional = false +python-versions = "<3.14,>=3.9" files = [ - {file = "PyQt6-6.7.1-1-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:7f397f4b38b23b5588eb2c0933510deb953d96b1f0323a916c4839c2a66ccccc"}, - {file = "PyQt6-6.7.1-1-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c2f202b7941aa74e5c7e1463a6f27d9131dbc1e6cabe85571d7364f5b3de7397"}, - {file = "PyQt6-6.7.1-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:f053378e3aef6248fa612c8afddda17f942fb63f9fe8a9aeb2a6b6b4cbb0eba9"}, - {file = "PyQt6-6.7.1-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:0adb7914c732ad1dee46d9cec838a98cb2b11bc38cc3b7b36fbd8701ae64bf47"}, - {file = "PyQt6-6.7.1-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2d771fa0981514cb1ee937633dfa64f14caa902707d9afffab66677f3a73e3da"}, - {file = "PyQt6-6.7.1-cp38-abi3-win_amd64.whl", hash = "sha256:fa3954698233fe286a8afc477b84d8517f0788eb46b74da69d3ccc0170d3714c"}, - {file = "PyQt6-6.7.1.tar.gz", hash = "sha256:3672a82ccd3a62e99ab200a13903421e2928e399fda25ced98d140313ad59cb9"}, + {file = "PySide6-6.8.1.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:805728a7ed58352a02689b953ddbe29af1c8944f8c7f2c28312dc0b69f64b85e"}, + {file = "PySide6-6.8.1.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:70f8c4745d981ebb5bb93d7b825222532d553373b68b9db7a42cfcee25cafc9a"}, + {file = "PySide6-6.8.1.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:de80ac62087a716b2bada2e3ddd739c5d176dc4be819abef91274d53d75f4e58"}, + {file = "PySide6-6.8.1.1-cp39-abi3-win_amd64.whl", hash = "sha256:60a2551053fa69845b893fb821507e2cc89d3a8a8b43726d568acd1250ad44fb"}, ] [package.dependencies] -PyQt6-Qt6 = ">=6.7.0,<6.8.0" -PyQt6-sip = ">=13.8,<14" +PySide6-Addons = "6.8.1.1" +PySide6-Essentials = "6.8.1.1" +shiboken6 = "6.8.1.1" [[package]] -name = "pyqt6-qt6" -version = "6.7.3" -description = "The subset of a Qt installation needed by PyQt6." -optional = true -python-versions = "*" +name = "pyside6-addons" +version = "6.8.1.1" +description = "Python bindings for the Qt cross-platform application and UI framework (Addons)" +optional = false +python-versions = "<3.14,>=3.9" files = [ - {file = "PyQt6_Qt6-6.7.3-py3-none-macosx_10_14_x86_64.whl", hash = "sha256:f517a93b6b1a814d4aa6587adc312e812ebaf4d70415bb15cfb44268c5ad3f5f"}, - {file = "PyQt6_Qt6-6.7.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8551732984fb36a5f4f3db51eafc4e8e6caf18617365830285306f2db17a94c2"}, - {file = "PyQt6_Qt6-6.7.3-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:50c7482bcdcf2bb78af257fb10ed8b582f8daf91d829782393bc50ac5a0a900c"}, - {file = "PyQt6_Qt6-6.7.3-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:cb525fdd393332de60887953029276a44de480fce1d785251ae639580f5e7246"}, - {file = "PyQt6_Qt6-6.7.3-py3-none-win_amd64.whl", hash = "sha256:36ea0892b8caeb983af3f285f45fb8dfbb93cfd972439f4e01b7efb2868f6230"}, + {file = "PySide6_Addons-6.8.1.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:83d35d7a1a7dbd1a16b4040a26ad4d5cc030a2aed4d439241babee1225d6e58a"}, + {file = "PySide6_Addons-6.8.1.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5ef45aeadca37d658e44a41e11f2b2e43dfc34c780a6be1cd09d96a7696e6cc6"}, + {file = "PySide6_Addons-6.8.1.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:e1b4a20b0bcbc2e440faba62e0d164223b8fd6f041d749543bc3812979116c4c"}, + {file = "PySide6_Addons-6.8.1.1-cp39-abi3-win_amd64.whl", hash = "sha256:d8ae86944ac48cc9891666cf71565acebd403a953d0e050be4d41ac490788d0a"}, ] +[package.dependencies] +PySide6-Essentials = "6.8.1.1" +shiboken6 = "6.8.1.1" + [[package]] -name = "pyqt6-sip" -version = "13.8.0" -description = "The sip module support for PyQt6" -optional = true -python-versions = ">=3.8" +name = "pyside6-essentials" +version = "6.8.1.1" +description = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" +optional = false +python-versions = "<3.14,>=3.9" files = [ - {file = "PyQt6_sip-13.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cedd554c643e54c4c2e12b5874781a87441a1b405acf3650a4a2e1df42aae231"}, - {file = "PyQt6_sip-13.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f57275b5af774529f9838adcfb58869ba3ebdaf805daea113bb0697a96a3f3cb"}, - {file = "PyQt6_sip-13.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:835ed22eab977f75fd77e60d4ff308a1fa794b1d0c04849311f36d2a080cdf3b"}, - {file = "PyQt6_sip-13.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d8b22a6850917c68ce83fc152a8b606ecb2efaaeed35be53110468885d6cdd9d"}, - {file = "PyQt6_sip-13.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b203b6fbae4a8f2d27f35b7df46200057033d9ecd9134bcf30e3eab66d43572c"}, - {file = "PyQt6_sip-13.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:beaddc1ec96b342f4e239702f91802706a80cb403166c2da318cec4ad8b790cb"}, - {file = "PyQt6_sip-13.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5c086b7c9c7996ea9b7522646cc24eebbf3591ec9dd38f65c0a3fdb0dbeaac7"}, - {file = "PyQt6_sip-13.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:dd168667addf01f8a4b0fa7755323e43e4cd12ca4bade558c61f713a5d48ba1a"}, - {file = "PyQt6_sip-13.8.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:33d9b399fc9c9dc99496266842b0fb2735d924604774e97cf9b555667cc0fc59"}, - {file = "PyQt6_sip-13.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:056af69d1d8d28d5968066ec5da908afd82fc0be07b67cf2b84b9f02228416ce"}, - {file = "PyQt6_sip-13.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:08dd81037a2864982ece2bf9891f3bf4558e247034e112993ea1a3fe239458cb"}, - {file = "PyQt6_sip-13.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:fbb249b82c53180f1420571ece5dc24fea1188ba435923edd055599dffe7abfb"}, - {file = "PyQt6_sip-13.8.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:6bce6bc5870d9e87efe5338b1ee4a7b9d7d26cdd16a79a5757d80b6f25e71edc"}, - {file = "PyQt6_sip-13.8.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd81144b0770084e8005d3a121c9382e6f9bc8d0bb320dd618718ffe5090e0e6"}, - {file = "PyQt6_sip-13.8.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:755beb5d271d081e56618fb30342cdd901464f721450495cb7cb0212764da89e"}, - {file = "PyQt6_sip-13.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:7a0bbc0918eab5b6351735d40cf22cbfa5aa2476b55e0d5fe881aeed7d871c29"}, - {file = "PyQt6_sip-13.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7f84c472afdc7d316ff683f63129350d645ef82d9b3fd75a609b08472d1f7291"}, - {file = "PyQt6_sip-13.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1bf29e95f10a8a00819dac804ca7e5eba5fc1769adcd74c837c11477bf81954"}, - {file = "PyQt6_sip-13.8.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:9ea9223c94906efd68148f12ae45b51a21d67e86704225ddc92bce9c54e4d93c"}, - {file = "PyQt6_sip-13.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:2559afa68825d08de09d71c42f3b6ad839dcc30f91e7c6d0785e07830d5541a5"}, - {file = "PyQt6_sip-13.8.0.tar.gz", hash = "sha256:2f74cf3d6d9cab5152bd9f49d570b2dfb87553ebb5c4919abfde27f5b9fd69d4"}, + {file = "PySide6_Essentials-6.8.1.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:25f3fdb281ac3b442f08250e3284d3b1944f7c64c62ed93b57678a62c199cf46"}, + {file = "PySide6_Essentials-6.8.1.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:62b64842a91114c224c41eeb6a8c8f255ba60268bc5ac19724f944d60e2277c6"}, + {file = "PySide6_Essentials-6.8.1.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:e0c1cc3cfb2ea5eea70748da7d22032a59ea641e24988f543d5b274c0adab065"}, + {file = "PySide6_Essentials-6.8.1.1-cp39-abi3-win_amd64.whl", hash = "sha256:085f12e16db31eb0e802b21c64eabf582f54db6c44463a1f5e1814d897b1f2c0"}, ] +[package.dependencies] +shiboken6 = "6.8.1.1" + [[package]] name = "python-engineio" version = "4.10.1" @@ -1645,6 +1632,19 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy", "pycodestyle", "pyde doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.12.0)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0)", "sphinx-design (>=0.4.0)"] test = ["array-api-strict", "asv", "gmpy2", "hypothesis (>=6.30)", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +[[package]] +name = "shiboken6" +version = "6.8.1.1" +description = "Python/C++ bindings helper module" +optional = false +python-versions = "<3.14,>=3.9" +files = [ + {file = "shiboken6-6.8.1.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:42fbb173a772c4e059dbeafb302e96f6ea8e1c9bacf05fab71ea7eb0d8f97b01"}, + {file = "shiboken6-6.8.1.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:d672df0f29dc5f44de7205c1acae4d0471ba8371bb1d68fdacbf1686f4d22a96"}, + {file = "shiboken6-6.8.1.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:ff1b22a66476b042d3dc09870edca353fdac1c1f517a4cdc364b24e296213ecd"}, + {file = "shiboken6-6.8.1.1-cp39-abi3-win_amd64.whl", hash = "sha256:26f7041c77058a8ecfb9345caa187250b199de79cfb37e33936e5fbd468a7780"}, +] + [[package]] name = "simple-websocket" version = "1.1.0" @@ -2003,10 +2003,10 @@ static-analysis = ["autopep8 (>=2.0,<3.0)", "ruff (>=0.7.0,<0.8.0)"] test = ["pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)"] [extras] -client = ["minio", "mpv", "pillow", "pymediainfo", "pyqt6", "pyyaml", "qasync", "qrcode"] +client = ["minio", "mpv", "pillow", "pymediainfo", "pyyaml", "qasync", "qrcode"] server = ["alt-profanity-check"] [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "8c1f5823100350e920105e05612a3908d3f9055759d487324dd3a05b3542c1e4" +python-versions = "^3.9,<3.14" +content-hash = "6b9248ff7ee1083b094e1110ea307b6b22d5922faa9fbcb40199f05dec644d6c" diff --git a/pyproject.toml b/pyproject.toml index 40e1f9d..d2ea991 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ keywords = ["karaoke", "youtube", "web", "audio", "video", "player", "qt"] syng = "syng.main:main" [tool.poetry.dependencies] -python = "^3.9" +python = "^3.9,<3.14" python-socketio = "^5.10.0" aiohttp = "^3.9.1" yarl = "<1.14.0" @@ -41,9 +41,9 @@ qrcode = { version = "^7.4.2", optional = true } pymediainfo = { version = "^6.1.0", optional = true } pyyaml = { version = "^6.0.1", optional = true } alt-profanity-check = {version = "^1.4.1", optional = true} -pyqt6 = {version="^6.7.1", optional = true} mpv = {version = "^1.0.7", optional = true} qasync = {version = "^0.27.1", optional = true} +pyside6 = "^6.8.1.1" [tool.poetry.group.dev.dependencies] types-pyyaml = "^6.0.12.12" @@ -54,7 +54,7 @@ requirements-parser = "^0.11.0" [tool.poetry.extras] -client = ["minio", "pillow", "qrcode", "pymediainfo", "pyyaml", "pyqt6", "mpv", "qasync"] +client = ["minio", "pillow", "qrcode", "pymediainfo", "pyyaml", "mpv", "qasync"] server = ["alt-profanity-check"] [build-system] diff --git a/syng/gui.py b/syng/gui.py index a05d007..9b4fbc5 100644 --- a/syng/gui.py +++ b/syng/gui.py @@ -27,9 +27,9 @@ except ImportError: pass from qasync import QEventLoop, QApplication -from PyQt6.QtCore import QTimer, Qt -from PyQt6.QtGui import QCloseEvent, QIcon, QPixmap -from PyQt6.QtWidgets import ( +from PySide6.QtCore import QDateTime, QTimer, Qt +from PySide6.QtGui import QCloseEvent, QIcon, QPixmap +from PySide6.QtWidgets import ( QCheckBox, QComboBox, QDateTimeEdit, @@ -145,7 +145,7 @@ class OptionFrame(QWidget): lambda: self.path_setter( file_name_widget, QFileDialog.getOpenFileName( - self, "Select File", directory=os.path.dirname(file_name_widget.text()) + self, "Select File", dir=os.path.dirname(file_name_widget.text()) )[0], ) ) @@ -179,7 +179,7 @@ class OptionFrame(QWidget): lambda: self.path_setter( folder_name_widget, QFileDialog.getExistingDirectory( - self, "Select Folder", directory=folder_name_widget.text() + self, "Select Folder", dir=folder_name_widget.text() ), ) ) @@ -293,7 +293,7 @@ class OptionFrame(QWidget): self.form_layout.addRow(label, self.choose_options[name]) self.rows[name] = (label, self.choose_options[name]) - def add_date_time_option(self, name: str, description: str, value: str) -> None: + def add_date_time_option(self, name: str, description: str, value: Optional[str]) -> None: label = QLabel(description, self) date_time_layout = QHBoxLayout() date_time_widget = QDateTimeEdit(self) @@ -305,10 +305,12 @@ class OptionFrame(QWidget): self.date_time_options[name] = (date_time_widget, date_time_enabled) date_time_widget.setCalendarPopup(True) try: - date_time_widget.setDateTime(datetime.fromisoformat(value)) + if value is None: + raise ValueError("Value is None") + date_time_widget.setDateTime(QDateTime.fromString(value, Qt.DateFormat.ISODate)) date_time_enabled.setChecked(True) except (TypeError, ValueError): - date_time_widget.setDateTime(datetime.now()) + date_time_widget.setDateTime(QDateTime.currentDateTime()) date_time_widget.setEnabled(False) date_time_enabled.setChecked(False) @@ -365,7 +367,7 @@ class OptionFrame(QWidget): config[name] = None continue try: - config[name] = picker.dateTime().toPyDateTime().isoformat() + config[name] = picker.dateTime().toString(format=Qt.DateFormat.ISODate) except ValueError: config[name] = None @@ -486,7 +488,7 @@ class GeneralConfig(OptionFrame): class SyngGui(QMainWindow): - def closeEvent(self, a0: Optional[QCloseEvent]) -> None: + def closeEvent(self, event: Optional[QCloseEvent]) -> None: if self.client is not None: self.client.quit_callback() @@ -518,11 +520,11 @@ class SyngGui(QMainWindow): spacer_item = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.buttons_layout.addItem(spacer_item) - self.savebutton = QPushButton("Save") - self.savebutton.clicked.connect(self.save_config) - self.buttons_layout.addWidget(self.savebutton) + # self.savebutton = QPushButton("Save") + # self.savebutton.clicked.connect(self.save_config) + # self.buttons_layout.addWidget(self.savebutton) - self.startbutton = QPushButton("Save and Start") + self.startbutton = QPushButton("Connect") self.startbutton.clicked.connect(self.start_syng_client) self.buttons_layout.addWidget(self.startbutton) diff --git a/syng/resources.py b/syng/resources.py index 6349bf3..44b7686 100644 --- a/syng/resources.py +++ b/syng/resources.py @@ -3,7 +3,7 @@ # Created by: The Resource Compiler for Qt version 6.7.2 # WARNING! All changes made in this file will be lost! -from PyQt6 import QtCore +from PySide6 import QtCore qt_resource_data = b"\ \x00\x00\x1cc\