From 479ae92da73b8d40d65b637fa5c74875f26a903a Mon Sep 17 00:00:00 2001 From: "emdee@spm.plastiras.org" Date: Sat, 10 Feb 2024 21:37:10 +0000 Subject: [PATCH] tox_wrapper -> toxygen_wrapper --- src/toxygen_wrapper/tests/support_testing.py | 15 ++++++++------- src/toxygen_wrapper/tests/tests_wrapper.py | 14 +++++++------- src/toxygen_wrapper/tests/wrapper_mixin.py | 8 ++++---- src/toxygen_wrapper/tox.py | 10 +++++----- src/toxygen_wrapper/toxav.py | 4 ++-- src/toxygen_wrapper/toxencryptsave.py | 4 ++-- src/toxygen_wrapper/toxygen_echo.py | 12 ++++++------ 7 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/toxygen_wrapper/tests/support_testing.py b/src/toxygen_wrapper/tests/support_testing.py index d88f1a8..879ed72 100644 --- a/src/toxygen_wrapper/tests/support_testing.py +++ b/src/toxygen_wrapper/tests/support_testing.py @@ -38,11 +38,11 @@ try: except ImportError as e: nmap = False -import tox_wrapper -import tox_wrapper.toxcore_enums_and_consts as enums +import toxygen_wrapper +import toxygen_wrapper.toxcore_enums_and_consts as enums -from tox_wrapper.tests.support_http import bAreWeConnected -from tox_wrapper.tests.support_onions import (is_valid_fingerprint, +from toxygen_wrapper.tests.support_http import bAreWeConnected +from toxygen_wrapper.tests.support_onions import (is_valid_fingerprint, lIntroductionPoints, oGetStemController, sMapaddressResolv, sTorResolve) @@ -287,7 +287,7 @@ def tox_log_cb(_, level:int, source, line:int , func, message, userdata=None) -> def vAddLoggerCallback(tox_options, callback=toxygen_log_cb) -> None: if callback is None: - tox_wrapper.tox.Tox.libtoxcore.tox_options_set_log_callback( + toxygen_wrapper.tox.Tox.libtoxcore.tox_options_set_log_callback( tox_options._options_pointer, POINTER(None)()) tox_options.self_logger_cb = None @@ -296,7 +296,7 @@ def vAddLoggerCallback(tox_options, callback=toxygen_log_cb) -> None: c_callback = CFUNCTYPE(None, c_void_p, c_int, c_char_p, c_int, c_char_p, c_char_p, c_void_p) tox_options.self_logger_cb = c_callback(callback) - tox_wrapper.tox.Tox.libtoxcore.tox_options_set_log_callback( + toxygen_wrapper.tox.Tox.libtoxcore.tox_options_set_log_callback( tox_options._options_pointer, tox_options.self_logger_cb) LOG.debug("toxcore logging enabled") @@ -406,7 +406,7 @@ def get_audio(): def oToxygenToxOptions(oArgs, logger_cb=None): data = None - tox_options = tox_wrapper.tox.Tox.options_new() + tox_options = toxygen_wrapper.tox.Tox.options_new() if oArgs.proxy_type: tox_options.contents.proxy_type = int(oArgs.proxy_type) tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8') @@ -589,6 +589,7 @@ def lSdSamplerates(iDev:int) -> list: try: import sounddevice as sd except ImportError: + LOG.warn(f"Import of sounddevice failed - please pip install sounddevice") return [] samplerates = (32000, 44100, 48000, 96000, ) device = iDev diff --git a/src/toxygen_wrapper/tests/tests_wrapper.py b/src/toxygen_wrapper/tests/tests_wrapper.py index e3121cc..06e0a23 100644 --- a/src/toxygen_wrapper/tests/tests_wrapper.py +++ b/src/toxygen_wrapper/tests/tests_wrapper.py @@ -85,10 +85,10 @@ except ImportError as e: logging.log(logging.DEBUG, f"color_runner not available: {e}") color_runner = None -import tox_wrapper -import tox_wrapper.toxcore_enums_and_consts as enums -from tox_wrapper.tox import Tox, UINT32_MAX, ToxError -from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, +import toxygen_wrapper +import toxygen_wrapper.toxcore_enums_and_consts as enums +from toxygen_wrapper.tox import Tox, UINT32_MAX, ToxError +from toxygen_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTION, TOX_FILE_CONTROL, TOX_MESSAGE_TYPE, @@ -99,8 +99,8 @@ try: import support_testing as ts import support_onions as so except ImportError: - import tox_wrapper.tests.support_testing as ts - import tox_wrapper.tests.support_onions as so + import toxygen_wrapper.tests.support_testing as ts + import toxygen_wrapper.tests.support_onions as so from wrapper_mixin import WrapperMixin @@ -1609,7 +1609,7 @@ def iMain(oArgs, failfast=True) -> int: def oTestsToxOptions(oArgs): data = None - tox_options = tox_wrapper.tox.Tox.options_new() + tox_options = toxygen_wrapper.tox.Tox.options_new() if oArgs.proxy_type: tox_options.contents.proxy_type = int(oArgs.proxy_type) tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8') diff --git a/src/toxygen_wrapper/tests/wrapper_mixin.py b/src/toxygen_wrapper/tests/wrapper_mixin.py index cfeff60..d34d6df 100644 --- a/src/toxygen_wrapper/tests/wrapper_mixin.py +++ b/src/toxygen_wrapper/tests/wrapper_mixin.py @@ -10,10 +10,10 @@ import threading from ctypes import * from typing import Union, Callable -import tox_wrapper.toxcore_enums_and_consts as enums -from tox_wrapper.tox import Tox, UINT32_MAX, ToxError +import toxygen_wrapper.toxcore_enums_and_consts as enums +from toxygen_wrapper.tox import Tox, UINT32_MAX, ToxError -from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTION, +from toxygen_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTION, TOX_FILE_CONTROL, TOX_MESSAGE_TYPE, TOX_SECRET_KEY_SIZE, @@ -22,7 +22,7 @@ from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTI try: import support_testing as ts except ImportError: - import tox_wrapper.tests.support_testing as ts + import toxygen_wrapper.tests.support_testing as ts sleep = time.sleep ADDR_SIZE = 38 * 2 diff --git a/src/toxygen_wrapper/tox.py b/src/toxygen_wrapper/tox.py index a54af56..f71bcf2 100644 --- a/src/toxygen_wrapper/tox.py +++ b/src/toxygen_wrapper/tox.py @@ -11,10 +11,10 @@ from datetime import datetime from typing import Union, Callable try: - from tox_wrapper.libtox import LibToxCore - from tox_wrapper.toxav import ToxAV - from tox_wrapper.toxcore_enums_and_consts import * - import tox_wrapper.toxcore_enums_and_consts as enum + from toxygen_wrapper.libtox import LibToxCore + from toxygen_wrapper.toxav import ToxAV + from toxygen_wrapper.toxcore_enums_and_consts import * + import toxygen_wrapper.toxcore_enums_and_consts as enum except: from libtox import LibToxCore from toxav import ToxAV @@ -1364,7 +1364,7 @@ class Tox: If hash is NULL or data is NULL while length is not 0 the function returns false, otherwise it returns true. - This function is a tox_wrapper to internal message-digest functions. + This function is a toxygen_wrapper to internal message-digest functions. :param hash: A valid memory location the hash data. It must be at least TOX_HASH_LENGTH bytes in size. :param data: Data to be hashed or NULL. diff --git a/src/toxygen_wrapper/toxav.py b/src/toxygen_wrapper/toxav.py index dfe9ec8..39fcc60 100644 --- a/src/toxygen_wrapper/toxav.py +++ b/src/toxygen_wrapper/toxav.py @@ -6,8 +6,8 @@ from ctypes import (CFUNCTYPE, POINTER, ArgumentError, byref, c_bool, c_char_p, from typing import Union, Callable try: - from tox_wrapper.libtox import LibToxAV - import tox_wrapper.toxav_enums as enum + from toxygen_wrapper.libtox import LibToxAV + import toxygen_wrapper.toxav_enums as enum except: from libtox import LibToxAV import toxav_enums as enum diff --git a/src/toxygen_wrapper/toxencryptsave.py b/src/toxygen_wrapper/toxencryptsave.py index 646d7bb..11828c1 100644 --- a/src/toxygen_wrapper/toxencryptsave.py +++ b/src/toxygen_wrapper/toxencryptsave.py @@ -1,8 +1,8 @@ # -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*- try: - from tox_wrapper import libtox - import tox_wrapper.toxencryptsave_enums_and_consts as enum + from toxygen_wrapper import libtox + import toxygen_wrapper.toxencryptsave_enums_and_consts as enum except: import libtox import toxencryptsave_enums_and_consts as enum diff --git a/src/toxygen_wrapper/toxygen_echo.py b/src/toxygen_wrapper/toxygen_echo.py index 374aeb1..856b3a4 100644 --- a/src/toxygen_wrapper/toxygen_echo.py +++ b/src/toxygen_wrapper/toxygen_echo.py @@ -31,14 +31,14 @@ def LOG_info(a): print('INFO_ '+a) def LOG_debug(a): print('DBUG_ '+a) def LOG_trace(a): pass # print('TRAC_ '+a) -from tox_wrapper import tox -import tox_wrapper.toxcore_enums_and_consts as enums -from tox_wrapper.tox import Tox, UINT32_MAX -from tox_wrapper.toxcore_enums_and_consts import TOX_CONNECTION, TOX_USER_STATUS, \ +from toxygen_wrapper import tox +import toxygen_wrapper.toxcore_enums_and_consts as enums +from toxygen_wrapper.tox import Tox, UINT32_MAX +from toxygen_wrapper.toxcore_enums_and_consts import TOX_CONNECTION, TOX_USER_STATUS, \ TOX_MESSAGE_TYPE, TOX_PUBLIC_KEY_SIZE, TOX_FILE_CONTROL, TOX_FILE_KIND -import tox_wrapper.tests.support_testing as ts -from tox_wrapper.tests.support_testing import oMainArgparser +import toxygen_wrapper.tests.support_testing as ts +from toxygen_wrapper.tests.support_testing import oMainArgparser def sleep(fSec) -> None: if 'QtCore' in globals():