qtpy
This commit is contained in:
parent
7cebe9cd9f
commit
f62e28f5b4
@ -1,5 +1,6 @@
|
||||
# the versions are the current ones tested - may work with earlier versions
|
||||
# choose one of PyQt5 PyQt6 PySide2 PySide6
|
||||
QtPy >= 2.4.1
|
||||
PyAudio >= 0.2.13
|
||||
numpy >= 1.26.1
|
||||
opencv_python >= 4.8.0
|
||||
|
@ -12,6 +12,7 @@ faulthandler.enable()
|
||||
import warnings
|
||||
warnings.filterwarnings('ignore')
|
||||
|
||||
import tox_wrapper.tests.support_testing as ts
|
||||
try:
|
||||
from trepan.interfaces import server as Mserver
|
||||
from trepan.api import debug
|
||||
@ -28,15 +29,16 @@ from user_data.settings import *
|
||||
from user_data.settings import Settings
|
||||
from user_data import settings
|
||||
import utils.util as util
|
||||
import tox_wrapper.tests.support_testing as ts
|
||||
with ts.ignoreStderr():
|
||||
import pyaudio
|
||||
|
||||
__maintainer__ = 'Ingvar'
|
||||
__version__ = '0.5.0+'
|
||||
__version__ = '1.0.0' # was 0.5.0+
|
||||
|
||||
sleep = time.sleep
|
||||
|
||||
os.environ['QT_API'] = 'pyqt5'
|
||||
|
||||
def reset():
|
||||
Settings.reset_auto_profile()
|
||||
|
||||
@ -46,7 +48,7 @@ def clean():
|
||||
util.remove(directory)
|
||||
|
||||
def print_toxygen_version():
|
||||
print('Toxygen ' + __version__)
|
||||
print('toxygen ' + __version__)
|
||||
|
||||
def setup_default_audio():
|
||||
# need:
|
||||
|
@ -10,7 +10,7 @@ from copy import deepcopy
|
||||
from gevent import monkey; monkey.patch_all(); del monkey # noqa
|
||||
import gevent
|
||||
|
||||
from PyQt5 import QtWidgets, QtGui, QtCore
|
||||
from qtpy import QtWidgets, QtGui, QtCore
|
||||
from qtpy.QtCore import QTimer
|
||||
from qtpy.QtWidgets import QApplication
|
||||
|
||||
@ -85,6 +85,7 @@ LOG = logging.getLogger('app')
|
||||
|
||||
IDLE_PERIOD = 0.10
|
||||
iNODES=8
|
||||
bSHOW_TRAY=False
|
||||
|
||||
def setup_logging(oArgs):
|
||||
global LOG
|
||||
@ -740,7 +741,7 @@ class App:
|
||||
self._groups_service,
|
||||
history,
|
||||
self._contacts_provider)
|
||||
if True: # try it
|
||||
if bSHOW_TRAY:
|
||||
self._tray = tray.init_tray(self._profile,
|
||||
self._settings,
|
||||
self._ms, self._toxes)
|
||||
@ -755,7 +756,7 @@ class App:
|
||||
self._calls_manager,
|
||||
self._groups_service, self._toxes, self)
|
||||
|
||||
if True: # try it
|
||||
if bSHOW_TRAY: # broken
|
||||
# the tray icon does not die with the app
|
||||
self._tray.show()
|
||||
self._ms.show()
|
||||
|
@ -16,7 +16,7 @@ import common.tox_save
|
||||
from utils import ui as util_ui
|
||||
import tox_wrapper.tests.support_testing as ts
|
||||
from middleware.threads import invoke_in_main_thread
|
||||
from main import sleep
|
||||
from __main__ import sleep
|
||||
from middleware.threads import BaseThread
|
||||
|
||||
global LOG
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import QtWidgets
|
||||
from qtpy import QtWidgets
|
||||
|
||||
|
||||
class DesktopGrabber:
|
||||
|
@ -2,8 +2,8 @@
|
||||
import random
|
||||
import urllib.request
|
||||
from utils.util import *
|
||||
from PyQt5 import QtNetwork
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtNetwork
|
||||
from qtpy import QtCore
|
||||
try:
|
||||
import certifi
|
||||
from io import BytesIO
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
from user_data.settings import *
|
||||
from PyQt5 import QtCore, QtGui
|
||||
from qtpy import QtCore, QtGui
|
||||
from tox_wrapper.toxcore_enums_and_consts import TOX_PUBLIC_KEY_SIZE
|
||||
import utils.util as util
|
||||
import common.event as event
|
||||
@ -165,7 +165,7 @@ class BaseContact:
|
||||
# contact.set_widget(item_widget)
|
||||
# File "/mnt/o/var/local/src/toxygen/toxygen/contacts/contact.py", line 320, in set_widget
|
||||
if not self._widget:
|
||||
LOG_WARN("BC.init_widget self._widget is NULL")
|
||||
LOG.warn("BC.init_widget self._widget is NULL")
|
||||
return
|
||||
self._widget.name.setText(self._name)
|
||||
self._widget.status_message.setText(self._status_message)
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
from PyQt5 import QtWidgets
|
||||
from qtpy import QtWidgets
|
||||
|
||||
import utils.ui as util_ui
|
||||
from tox_wrapper.toxcore_enums_and_consts import *
|
||||
|
@ -2,7 +2,7 @@
|
||||
import sys
|
||||
import os
|
||||
import threading
|
||||
from PyQt5 import QtGui
|
||||
from qtpy import QtGui
|
||||
from tox_wrapper.toxcore_enums_and_consts import *
|
||||
from tox_wrapper.toxav_enums import *
|
||||
from tox_wrapper.tox import bin_to_string
|
||||
|
@ -2,7 +2,7 @@
|
||||
import sys
|
||||
import threading
|
||||
import queue
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
from bootstrap.bootstrap import *
|
||||
from bootstrap.bootstrap import download_nodes_list
|
||||
|
@ -2,7 +2,7 @@
|
||||
import json
|
||||
import urllib.request
|
||||
import utils.util as util
|
||||
from PyQt5 import QtNetwork, QtCore
|
||||
from qtpy import QtNetwork, QtCore
|
||||
try:
|
||||
import requests
|
||||
except ImportError:
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
|
||||
|
||||
def tray_notification(title, text, tray, window):
|
||||
|
@ -1,7 +1,7 @@
|
||||
import plugin_super_class
|
||||
import threading
|
||||
import time
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
from subprocess import check_output
|
||||
import json
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import plugin_super_class
|
||||
from PyQt5 import QtWidgets, QtCore
|
||||
from qtpy import QtWidgets, QtCore
|
||||
import json
|
||||
import importlib
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import plugin_super_class
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
import time
|
||||
|
||||
|
||||
|
@ -5,10 +5,10 @@ import re
|
||||
import math
|
||||
import plugin_super_class
|
||||
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtSvg import *
|
||||
from qtpy.QtCore import *
|
||||
from qtpy.QtWidgets import *
|
||||
from qtpy.QtGui import *
|
||||
from qtpy.QtSvg import *
|
||||
|
||||
|
||||
START_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import plugin_super_class
|
||||
import threading
|
||||
import time
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
|
||||
class InvokeEvent(QtCore.QEvent):
|
||||
|
@ -2,7 +2,7 @@
|
||||
import plugin_super_class
|
||||
import threading
|
||||
import time
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
|
||||
class InvokeEvent(QtCore.QEvent):
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
import os
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
import utils.ui as util_ui
|
||||
import common.tox_save as tox_save
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import plugin_super_class
|
||||
from PyQt5 import QtGui, QtCore, QtWidgets
|
||||
from qtpy import QtGui, QtCore, QtWidgets
|
||||
|
||||
|
||||
class SearchPlugin(plugin_super_class.PluginSuperClass):
|
||||
|
@ -1,5 +1,5 @@
|
||||
import plugin_super_class
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
import json
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ from utils import util
|
||||
import json
|
||||
import os
|
||||
from collections import OrderedDict
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
# LOG=util.log
|
||||
global LOG
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
try:
|
||||
from PyQt5 import QtCore
|
||||
from qtpy import QtCore
|
||||
except ImportError:
|
||||
from PyQt4 import QtCore
|
||||
|
||||
|
@ -87,7 +87,7 @@ try:
|
||||
except ImportError:
|
||||
bIS_NOT_TOXYGEN = True
|
||||
|
||||
# from PyQt5 import QtCore
|
||||
# from qtpy import QtCore
|
||||
import time
|
||||
|
||||
sleep = time.sleep
|
||||
|
2
toxygen/third_party/qweechat/about.py
vendored
2
toxygen/third_party/qweechat/about.py
vendored
@ -22,7 +22,7 @@
|
||||
|
||||
"""About dialog box."""
|
||||
|
||||
from PyQt5 import QtCore, QtWidgets as QtGui
|
||||
from qtpy import QtCore, QtWidgets as QtGui
|
||||
|
||||
from third_party.qweechat.version import qweechat_version
|
||||
|
||||
|
4
toxygen/third_party/qweechat/buffer.py
vendored
4
toxygen/third_party/qweechat/buffer.py
vendored
@ -24,8 +24,8 @@
|
||||
|
||||
from pkg_resources import resource_filename
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
from qtpy.QtCore import pyqtSignal
|
||||
Signal = pyqtSignal
|
||||
|
||||
from third_party.qweechat.chat import ChatTextEdit
|
||||
|
2
toxygen/third_party/qweechat/chat.py
vendored
2
toxygen/third_party/qweechat/chat.py
vendored
@ -24,7 +24,7 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from third_party.qweechat import config
|
||||
from third_party.qweechat.weechat import color
|
||||
|
2
toxygen/third_party/qweechat/connection.py
vendored
2
toxygen/third_party/qweechat/connection.py
vendored
@ -22,7 +22,7 @@
|
||||
|
||||
"""Connection window."""
|
||||
|
||||
from PyQt5 import QtGui, QtWidgets
|
||||
from qtpy import QtGui, QtWidgets
|
||||
|
||||
|
||||
class ConnectionDialog(QtWidgets.QDialog):
|
||||
|
2
toxygen/third_party/qweechat/debug.py
vendored
2
toxygen/third_party/qweechat/debug.py
vendored
@ -22,7 +22,7 @@
|
||||
|
||||
"""Debug window."""
|
||||
|
||||
from PyQt5 import QtWidgets
|
||||
from qtpy import QtWidgets
|
||||
|
||||
from third_party.qweechat.chat import ChatTextEdit
|
||||
from third_party.qweechat.input import InputLineEdit
|
||||
|
4
toxygen/third_party/qweechat/input.py
vendored
4
toxygen/third_party/qweechat/input.py
vendored
@ -22,8 +22,8 @@
|
||||
|
||||
"""Input line for chat and debug window."""
|
||||
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from qtpy import QtCore, QtWidgets
|
||||
from qtpy.QtCore import pyqtSignal
|
||||
Signal = pyqtSignal
|
||||
|
||||
class InputLineEdit(QtWidgets.QLineEdit):
|
||||
|
4
toxygen/third_party/qweechat/network.py
vendored
4
toxygen/third_party/qweechat/network.py
vendored
@ -26,8 +26,8 @@ import hashlib
|
||||
import secrets
|
||||
import struct
|
||||
|
||||
from PyQt5 import QtCore, QtNetwork
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from qtpy import QtCore, QtNetwork
|
||||
from qtpy.QtCore import pyqtSignal
|
||||
Signal = pyqtSignal
|
||||
|
||||
from third_party.qweechat import config
|
||||
|
2
toxygen/third_party/qweechat/preferences.py
vendored
2
toxygen/third_party/qweechat/preferences.py
vendored
@ -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):
|
||||
|
2
toxygen/third_party/qweechat/qweechat.py
vendored
2
toxygen/third_party/qweechat/qweechat.py
vendored
@ -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 third_party.qweechat import config
|
||||
from third_party.qweechat.about import AboutDialog
|
||||
|
@ -1,6 +1,6 @@
|
||||
import threading
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
import wave
|
||||
|
||||
from ui import widgets
|
||||
|
@ -1,5 +1,5 @@
|
||||
from tox_wrapper.toxcore_enums_and_consts import *
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
from utils.util import *
|
||||
from ui.widgets import DataLabel
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import *
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import CenteredWidget
|
||||
from PyQt5 import uic, QtWidgets, QtCore
|
||||
from qtpy import uic, QtWidgets, QtCore
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import uic, QtWidgets
|
||||
from qtpy import uic, QtWidgets
|
||||
import utils.util as util
|
||||
from ui.widgets import *
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import CenteredWidget
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
from ui.widgets import *
|
||||
from tox_wrapper.toxcore_enums_and_consts import *
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import *
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
import os.path
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
import os
|
||||
|
||||
from PyQt5 import uic
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import uic
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
from qtpy.QtGui import (QColor, QTextCharFormat, QFont, QSyntaxHighlighter, QFontMetrics)
|
||||
|
||||
from ui.contact_items import *
|
||||
@ -146,6 +146,7 @@ class LogDialog(QtWidgets.QDialog, QtWidgets.QPlainTextEdit):
|
||||
def test(self):
|
||||
# FixMe: 65:8: E1101: Instance of 'QTextEditLogger' has no 'selectAll' member (no-member)
|
||||
# :66:8: E1101: Instance of 'QTextEditLogger' has no 'copy' member (no-member)
|
||||
if hasattr(self._logTextBox, 'selectAll'):
|
||||
self._logTextBox.selectAll()
|
||||
self._logTextBox.copy()
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import urllib
|
||||
import re
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
|
||||
from ui.widgets import RubberBandWindow, create_menu, QRightClickButton, CenteredWidget, LineEdit
|
||||
import utils.util as util
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets, uic
|
||||
from qtpy import QtCore, QtGui, QtWidgets, uic
|
||||
|
||||
|
||||
from user_data.settings import *
|
||||
|
@ -7,7 +7,7 @@ import re
|
||||
from ui.widgets import *
|
||||
from messenger.messages import MESSAGE_AUTHOR
|
||||
from file_transfers.file_transfers import *
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
|
||||
class MessageBrowser(QtWidgets.QTextBrowser):
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import CenteredWidget, LineEdit, DialogWithResult
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
import utils.ui as util_ui
|
||||
|
||||
global LOG
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import CenteredWidget
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
from ui.contact_items import *
|
||||
|
@ -2,7 +2,7 @@ from ui.widgets import CenteredWidget
|
||||
import utils.ui as util_ui
|
||||
from utils.util import join_path, get_images_directory, get_views_path
|
||||
from user_data.settings import Settings
|
||||
from PyQt5 import QtGui, QtCore, uic
|
||||
from qtpy import QtGui, QtCore, uic
|
||||
|
||||
|
||||
class ProfileSettings(CenteredWidget):
|
||||
|
@ -1,5 +1,5 @@
|
||||
from ui.widgets import CenteredWidget, LineEdit
|
||||
from PyQt5 import uic
|
||||
from qtpy import uic
|
||||
import utils.util as util
|
||||
import utils.ui as util_ui
|
||||
from ui.contact_items import *
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import QtWidgets, QtGui, QtCore
|
||||
from qtpy import QtWidgets, QtGui, QtCore
|
||||
from utils.ui import tr
|
||||
from utils.util import *
|
||||
from ui.password_screen import UnlockAppScreen
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
import utils.ui as util_ui
|
||||
import logging
|
||||
|
||||
|
@ -4,7 +4,7 @@ import utils.ui as util_ui
|
||||
import os
|
||||
import platform
|
||||
import urllib
|
||||
from PyQt5 import QtNetwork, QtCore
|
||||
from qtpy import QtNetwork, QtCore
|
||||
import subprocess
|
||||
|
||||
global LOG
|
||||
|
@ -10,6 +10,7 @@ from common.event import Event
|
||||
import utils.ui as util_ui
|
||||
import utils.util as util_utils
|
||||
import user_data
|
||||
from toxygen_wrapper.tests import support_testing as ts
|
||||
|
||||
global LOG
|
||||
import logging
|
||||
@ -259,7 +260,9 @@ class Settings(dict):
|
||||
# Static methods
|
||||
|
||||
@staticmethod
|
||||
def get_auto_profile(appdir):
|
||||
def get_auto_profile(appdir=None):
|
||||
if appdir is None:
|
||||
appdir = ts.get_user_config_path()
|
||||
# self._path =
|
||||
p = os.path.join(appdir, 'toxygen.json')
|
||||
if not os.path.isfile(p):
|
||||
@ -299,7 +302,8 @@ class Settings(dict):
|
||||
|
||||
@staticmethod
|
||||
def reset_auto_profile():
|
||||
p = os.path.join(os.path.dirname(app._path), 'toxygen.json')
|
||||
appdir = ts.get_user_config_path()
|
||||
p = os.path.join(appdir, 'toxygen.json')
|
||||
if os.path.isfile(p):
|
||||
with open(p) as fl:
|
||||
data = fl.read()
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PyQt5 import QtWidgets
|
||||
from qtpy import QtWidgets
|
||||
import utils.util as util
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user