From acb9e83c2958bfc67ac9cc493409ef6a35bb8e52 Mon Sep 17 00:00:00 2001 From: emdee Date: Thu, 8 Feb 2024 20:37:58 +0000 Subject: [PATCH] qtpy --- .gitignore | 1 - .rsync.sh | 7 +++++++ README.md | 2 ++ qweechat/about.py | 2 +- qweechat/buffer.py | 5 ++--- qweechat/chat.py | 2 +- qweechat/connection.py | 2 +- qweechat/debug.py | 2 +- qweechat/input.py | 5 ++--- qweechat/network.py | 5 ++--- qweechat/preferences.py | 2 +- qweechat/qweechat.py | 4 ++-- requirements.txt | 3 ++- setup.py | 2 +- 14 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 .rsync.sh diff --git a/.gitignore b/.gitignore index 0ed0d31..54e022d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Ignored files for Git -*.junk *.pyc *.pyo diff --git a/.rsync.sh b/.rsync.sh new file mode 100644 index 0000000..b42e669 --- /dev/null +++ b/.rsync.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +find * -name \*.py | xargs grep -l '[ ]*$' | xargs sed -i -e 's/[ ]*$//' +rsync "$@" -vax --include \*.py --exclude \*.log --exclude \*.out \ + --exclude \*.egg-info --exclude libs --exclude dist --exclude build \ + --exclude \*.pyc --exclude .pyl\* --exclude \*~ --exclude \*.so \ + ./ ../qweechat.git/|grep -v /$ diff --git a/README.md b/README.md index 656cc9d..cf27295 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,5 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with QWeeChat. If not, see . + +Up-to-date code is on https://git.plastiras.org/emdee/qweechat diff --git a/qweechat/about.py b/qweechat/about.py index ac28af0..8ec87ab 100644 --- a/qweechat/about.py +++ b/qweechat/about.py @@ -22,7 +22,7 @@ """About dialog box.""" -from PyQt5 import QtCore, QtWidgets as QtGui +from qtpy import QtCore, QtWidgets as QtGui from qweechat.version import qweechat_version diff --git a/qweechat/buffer.py b/qweechat/buffer.py index b51afd6..008ecde 100644 --- a/qweechat/buffer.py +++ b/qweechat/buffer.py @@ -24,9 +24,8 @@ from pkg_resources import resource_filename -from PyQt5 import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from qtpy import QtCore, QtGui, QtWidgets +from qtpy.QtCore import pyqtSignal as Signal from qweechat.chat import ChatTextEdit from qweechat.input import InputLineEdit diff --git a/qweechat/chat.py b/qweechat/chat.py index 328de1a..43c4568 100644 --- a/qweechat/chat.py +++ b/qweechat/chat.py @@ -24,7 +24,7 @@ import datetime -from PyQt5 import QtCore, QtWidgets, QtGui +from qtpy import QtCore, QtWidgets, QtGui from qweechat import config from qweechat.weechat import color diff --git a/qweechat/connection.py b/qweechat/connection.py index 43d898f..d867d2a 100644 --- a/qweechat/connection.py +++ b/qweechat/connection.py @@ -22,7 +22,7 @@ """Connection window.""" -from PyQt5 import QtGui, QtWidgets +from qtpy import QtGui, QtWidgets class ConnectionDialog(QtWidgets.QDialog): diff --git a/qweechat/debug.py b/qweechat/debug.py index 785be98..48be08e 100644 --- a/qweechat/debug.py +++ b/qweechat/debug.py @@ -22,7 +22,7 @@ """Debug window.""" -from PyQt5 import QtWidgets +from qtpy import QtWidgets from qweechat.chat import ChatTextEdit from qweechat.input import InputLineEdit diff --git a/qweechat/input.py b/qweechat/input.py index 739a63f..8ffcd29 100644 --- a/qweechat/input.py +++ b/qweechat/input.py @@ -22,9 +22,8 @@ """Input line for chat and debug window.""" -from PyQt5 import QtCore, QtWidgets -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from qtpy import QtCore, QtWidgets +from qtpy.QtCore import pyqtSignal as Signal class InputLineEdit(QtWidgets.QLineEdit): """Input line.""" diff --git a/qweechat/network.py b/qweechat/network.py index 5e3fe65..149837d 100644 --- a/qweechat/network.py +++ b/qweechat/network.py @@ -26,9 +26,8 @@ import hashlib import secrets import struct -from PyQt5 import QtCore, QtNetwork -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from qtpy import QtCore, QtNetwork +from qtoy.QtCore import pyqtSignal as Signal from qweechat import config from qweechat.debug import DebugDialog diff --git a/qweechat/preferences.py b/qweechat/preferences.py index fc415da..64315cf 100644 --- a/qweechat/preferences.py +++ b/qweechat/preferences.py @@ -22,7 +22,7 @@ """Preferences dialog box.""" -from PyQt5 import QtCore, QtWidgets as QtGui +from qtpy import QtCore, QtWidgets as QtGui class PreferencesDialog(QtGui.QDialog): diff --git a/qweechat/qweechat.py b/qweechat/qweechat.py index 96f8f6a..7bf059f 100644 --- a/qweechat/qweechat.py +++ b/qweechat/qweechat.py @@ -37,7 +37,7 @@ import sys import traceback from pkg_resources import resource_filename -from PyQt5 import QtCore, QtGui, QtWidgets +from qtpy import QtCore, QtGui, QtWidgets from qweechat import config from qweechat.about import AboutDialog @@ -90,7 +90,7 @@ class MainWindow(QtWidgets.QMainWindow): self.list_buffers.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) self.stacked_buffers.setSizePolicy(QtWidgets.QSizePolicy.Expanding, - QtWidgets.QSizePolicy.Expanding) + QtWidgets.QSizePolicy.Expanding) # MainWindow self.setCentralWidget(splitter) diff --git a/requirements.txt b/requirements.txt index c698f7e..df9b5f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -PyQt5 +# works with PyQt5 and maybe PySide as well +PyQt6 diff --git a/setup.py b/setup.py index ea2a234..dfdbe06 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,6 @@ setup( ] }, install_requires=[ - 'PySide6', + 'PyQt6', ], )