diff --git a/README.md b/README.md index 067c108..b71ea8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Toxygen -Toxygen is powerful cross-platform [Tox](https://tox.chat/) client written in pure Python3. +Toxygen is powerful cross-platform [Tox](https://tox.chat/) client +written in pure Python3. ### [Install](/docs/install.md) - [Contribute](/docs/contributing.md) - [Plugins](/docs/plugins.md) - [Compile](/docs/compile.md) - [Contact](/docs/contact.md) @@ -93,11 +94,11 @@ on pypi as it is a dependency. Just download and install it from https://git.plastiras.org/emdee/toxygen_wrapper This is being ported to Qt6 using qtpy https://github.com/spyder-ide/qtpy -It should run on PyQt5, PyQt6 and may run on PySide2 and PySide6 - YMMV. -You should be able to choose between them by setting the environment variable -QT_API to one of: pyqt5 pyqt6 pyside2 pyside6. +It now runs on PyQt5 and should soon run on PyQt6 and may run on PySide2 and +PySide6 - YMMV. You will be able to choose between them by setting the +environment variable QT_API to one of: pyqt5 pyqt6 pyside2 pyside6. -To install it, look in the Makefile for the install target and type +To install it, look in the Makefile for the install target and type ``` make install ``` diff --git a/ToDo.md b/ToDo.md index c0e7a72..99c0679 100644 --- a/ToDo.md +++ b/ToDo.md @@ -51,6 +51,13 @@ line. 2. https://git.plastiras.org/emdee/toxygen_wrapper needs packaging and making a dependency. +## Migration + +Migrate PyQt5 to qtpy - almost done. + +Maybe migrate gevent to asyncio, or look at https://pypi.org/project/asyncio-gevent/ + + ## Standards There's a standard for Tox clients that this has not been tested against: diff --git a/docs/install.md b/docs/install.md index b3c5457..7d2b773 100644 --- a/docs/install.md +++ b/docs/install.md @@ -21,8 +21,8 @@ Note: 32-bit Python isn't supported due to bug with videocalls. It is strictly r 3. Install PyAudio: ``pip install pyaudio`` 4. Install numpy: ``pip install numpy`` 5. Install OpenCV: ``pip install opencv-python`` -6. [Download toxygen](https://github.com/toxygen-project/toxygen/archive/master.zip) -7. Unpack archive +6. git clone --depth=1 https://git.plastiras.org/emdee/toxygen/ +7. I don't know 8. Download latest libtox.dll build, download latest libsodium.a build, put it into \toxygen\libs\ 9. Run \toxygen\main.py. @@ -30,15 +30,22 @@ Note: 32-bit Python isn't supported due to bug with videocalls. It is strictly r 1. Install latest Python3: ``sudo apt-get install python3`` -2. Install PyQt5: ``sudo apt-get install python3-pyqt5`` or ``sudo pip3 install pyqt5`` +2. Install PyQt5: ``sudo apt-get install python3-pyqt5`` 3. Install [toxcore](https://github.com/TokTok/c-toxcore) with toxav support) -4. Install PyAudio: -``sudo apt-get install portaudio19-dev`` and ``sudo apt-get install python3-pyaudio`` (or ``sudo pip3 install pyaudio``) -5. Install NumPy: ``sudo pip3 install numpy`` -6. Install [OpenCV](http://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html) or via ``sudo pip3 install opencv-python`` -7. [Download toxygen](https://git.plastiras.org/emdee/toxygen/) -8. Unpack archive +4. Install PyAudio: ``sudo apt-get install portaudio19-dev python3-pyaudio`` (or ``sudo pip3 install pyaudio``) +5. Install toxygen_wrapper https://git.plastiras.org/emdee/toxygen_wrapper +6. Install the rest of the requirements: ``sudo pip3 install -m requirements.txt`` +7. git clone --depth=1 [toxygen](https://git.plastiras.org/emdee/toxygen/) +8. Look in the Makefile for the install target and type +`` +make install +`` +You should set the PIP_EXE_MSYS and PYTHON_EXE_MSYS variables and it does +`` + ${PIP_EXE_MSYS} --python ${PYTHON_EXE_MSYS} install \ + --target ${PREFIX}/lib/python${PYTHON_MINOR}/site-packages/ \ + --upgrade . +`` 9. Run app: -``python3 main.py`` +``python3 ${PREFIX}/lib/python${PYTHON_MINOR}/site-packages/bin/toxygen`` -Optional: install toxygen using setup.py: ``python3 setup.py install`` diff --git a/pyproject.toml b/pyproject.toml index 2dc72d7..37d424a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,9 +31,12 @@ classifiers = [ # dynamic = ["version", "readme", "dependencies"] # cannot be dynamic ['license'] -[project.scripts] +[project.gui-scripts] toxygen = "toxygen.__main__:main" +[project.optional-dependencies] +weechat = ["weechat"] + #[project.license] #file = "LICENSE.md" diff --git a/requirements.txt b/requirements.txt index 449c2d4..09926ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ # the versions are the current ones tested - may work with earlier versions # choose one of PyQt5 PyQt6 PySide2 PySide6 +# for now only PyQt5 is working: +# AttributeError: module 'qtpy.QtCore' has no attribute 'pyqtSignal' +PyQt5 >= 5.15.10 QtPy >= 2.4.1 PyAudio >= 0.2.13 numpy >= 1.26.1 diff --git a/toxygen/third_party/qweechat/buffer.py b/toxygen/third_party/qweechat/buffer.py index 1cea215..0e86241 100644 --- a/toxygen/third_party/qweechat/buffer.py +++ b/toxygen/third_party/qweechat/buffer.py @@ -25,8 +25,7 @@ from pkg_resources import resource_filename from qtpy import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from PyQt5.QtCore import pyqtSignal as Signal from third_party.qweechat.chat import ChatTextEdit from third_party.qweechat.input import InputLineEdit diff --git a/toxygen/third_party/qweechat/input.py b/toxygen/third_party/qweechat/input.py index 4a34566..a0bb604 100644 --- a/toxygen/third_party/qweechat/input.py +++ b/toxygen/third_party/qweechat/input.py @@ -23,8 +23,7 @@ """Input line for chat and debug window.""" from qtpy import QtCore, QtWidgets -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from PyQt5.QtCore import pyqtSignal as Signal class InputLineEdit(QtWidgets.QLineEdit): """Input line.""" diff --git a/toxygen/third_party/qweechat/network.py b/toxygen/third_party/qweechat/network.py index c11194a..a1a9f07 100644 --- a/toxygen/third_party/qweechat/network.py +++ b/toxygen/third_party/qweechat/network.py @@ -27,8 +27,7 @@ import secrets import struct from qtpy import QtCore, QtNetwork -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from PyQt5.QtCore import pyqtSignal as Signal from third_party.qweechat import config from third_party.qweechat.debug import DebugDialog diff --git a/toxygen/ui/main_screen_widgets.py b/toxygen/ui/main_screen_widgets.py index a6a0847..4fff5a0 100644 --- a/toxygen/ui/main_screen_widgets.py +++ b/toxygen/ui/main_screen_widgets.py @@ -5,6 +5,7 @@ import re from qtpy import QtCore, QtGui, QtWidgets from PyQt5.QtCore import pyqtSignal +Signal = pyqtSignal from ui.widgets import RubberBandWindow, create_menu, QRightClickButton, CenteredWidget, LineEdit import utils.util as util @@ -397,7 +398,7 @@ class MainMenuButton(QtWidgets.QPushButton): class ClickableLabel(QtWidgets.QLabel): # FixMe: AttributeError: module 'qtpy.QtCore' has no attribute 'pyqtSignal' - clicked = pyqtSignal() + clicked = Signal() def __init__(self, *args): super().__init__(*args) diff --git a/toxygen/ui/tray.py b/toxygen/ui/tray.py index 90b3f78..d85f9bf 100644 --- a/toxygen/ui/tray.py +++ b/toxygen/ui/tray.py @@ -1,5 +1,5 @@ from qtpy import QtWidgets, QtGui, QtCore -from PyQt5.QtCore import pyqtSignal +from PyQt5.QtCore import pyqtSignal as Signal from utils.ui import tr from utils.util import * @@ -9,7 +9,7 @@ import os.path class SystemTrayIcon(QtWidgets.QSystemTrayIcon): # FixMe: AttributeError: module 'qtpy.QtCore' has no attribute 'pyqtSignal' - leftClicked = pyqtSignal() + leftClicked = Signal() def __init__(self, icon, parent=None): super().__init__(icon, parent) diff --git a/toxygen/ui/widgets.py b/toxygen/ui/widgets.py index ddb3994..fbec648 100644 --- a/toxygen/ui/widgets.py +++ b/toxygen/ui/widgets.py @@ -1,7 +1,6 @@ # -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*- from qtpy import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import pyqtSignal -Signal = pyqtSignal +from PyQt5.QtCore import pyqtSignal as Signal import utils.ui as util_ui import logging @@ -82,7 +81,7 @@ class QRightClickButton(QtWidgets.QPushButton): Button with right click support """ # FixMe: AttributeError: module 'qtpy.QtCore' has no attribute 'pyqtSignal' - rightClicked = pyqtSignal() + rightClicked = Signal() def __init__(self, parent=None): super().__init__(parent)