This commit is contained in:
emdee@spm.plastiras.org 2024-02-05 17:15:29 +00:00
parent 7cebe9cd9f
commit f62e28f5b4
55 changed files with 78 additions and 69 deletions

View file

@ -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

View file

@ -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:

View file

@ -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()

View file

@ -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

View file

@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from qtpy import QtWidgets
class DesktopGrabber:

View file

@ -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

View file

@ -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)

View file

@ -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 *

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -1,4 +1,4 @@
from PyQt5 import QtCore, QtWidgets
from qtpy import QtCore, QtWidgets
def tray_notification(title, text, tray, window):

View file

@ -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

View file

@ -1,5 +1,5 @@
import plugin_super_class
from PyQt5 import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore
import json
import importlib

View file

@ -1,5 +1,5 @@
import plugin_super_class
from PyQt5 import QtCore
from qtpy import QtCore
import time

View file

@ -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"

View file

@ -1,7 +1,7 @@
import plugin_super_class
import threading
import time
from PyQt5 import QtCore
from qtpy import QtCore
class InvokeEvent(QtCore.QEvent):

View file

@ -2,7 +2,7 @@
import plugin_super_class
import threading
import time
from PyQt5 import QtCore
from qtpy import QtCore
class InvokeEvent(QtCore.QEvent):

View file

@ -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

View file

@ -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):

View file

@ -1,5 +1,5 @@
import plugin_super_class
from PyQt5 import QtCore, QtWidgets
from qtpy import QtCore, QtWidgets
import json

View file

@ -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

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
try:
from PyQt5 import QtCore
from qtpy import QtCore
except ImportError:
from PyQt4 import QtCore

View file

@ -87,7 +87,7 @@ try:
except ImportError:
bIS_NOT_TOXYGEN = True
# from PyQt5 import QtCore
# from qtpy import QtCore
import time
sleep = time.sleep

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -22,7 +22,7 @@
"""Connection window."""
from PyQt5 import QtGui, QtWidgets
from qtpy import QtGui, QtWidgets
class ConnectionDialog(QtWidgets.QDialog):

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -1,6 +1,6 @@
import threading
from PyQt5 import QtCore, QtGui, QtWidgets
from qtpy import QtCore, QtGui, QtWidgets
import wave
from ui import widgets

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,4 @@
from PyQt5 import uic, QtWidgets
from qtpy import uic, QtWidgets
import utils.util as util
from ui.widgets import *

View file

@ -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

View file

@ -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 *

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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 *

View file

@ -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):

View file

@ -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

View file

@ -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 *

View file

@ -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):

View file

@ -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 *

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from qtpy import QtWidgets
import utils.util as util