tox_wrapper -> toxygen_wrapper
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
emdee@spm.plastiras.org 2024-02-10 21:37:10 +00:00
parent eb7287e659
commit 479ae92da7
7 changed files with 34 additions and 33 deletions

View File

@ -38,11 +38,11 @@ try:
except ImportError as e: except ImportError as e:
nmap = False nmap = False
import tox_wrapper import toxygen_wrapper
import tox_wrapper.toxcore_enums_and_consts as enums import toxygen_wrapper.toxcore_enums_and_consts as enums
from tox_wrapper.tests.support_http import bAreWeConnected from toxygen_wrapper.tests.support_http import bAreWeConnected
from tox_wrapper.tests.support_onions import (is_valid_fingerprint, from toxygen_wrapper.tests.support_onions import (is_valid_fingerprint,
lIntroductionPoints, lIntroductionPoints,
oGetStemController, oGetStemController,
sMapaddressResolv, sTorResolve) 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: def vAddLoggerCallback(tox_options, callback=toxygen_log_cb) -> None:
if callback is 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, tox_options._options_pointer,
POINTER(None)()) POINTER(None)())
tox_options.self_logger_cb = 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) 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_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._options_pointer,
tox_options.self_logger_cb) tox_options.self_logger_cb)
LOG.debug("toxcore logging enabled") LOG.debug("toxcore logging enabled")
@ -406,7 +406,7 @@ def get_audio():
def oToxygenToxOptions(oArgs, logger_cb=None): def oToxygenToxOptions(oArgs, logger_cb=None):
data = None data = None
tox_options = tox_wrapper.tox.Tox.options_new() tox_options = toxygen_wrapper.tox.Tox.options_new()
if oArgs.proxy_type: if oArgs.proxy_type:
tox_options.contents.proxy_type = int(oArgs.proxy_type) tox_options.contents.proxy_type = int(oArgs.proxy_type)
tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8') tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8')
@ -589,6 +589,7 @@ def lSdSamplerates(iDev:int) -> list:
try: try:
import sounddevice as sd import sounddevice as sd
except ImportError: except ImportError:
LOG.warn(f"Import of sounddevice failed - please pip install sounddevice")
return [] return []
samplerates = (32000, 44100, 48000, 96000, ) samplerates = (32000, 44100, 48000, 96000, )
device = iDev device = iDev

View File

@ -85,10 +85,10 @@ except ImportError as e:
logging.log(logging.DEBUG, f"color_runner not available: {e}") logging.log(logging.DEBUG, f"color_runner not available: {e}")
color_runner = None color_runner = None
import tox_wrapper import toxygen_wrapper
import tox_wrapper.toxcore_enums_and_consts as enums import toxygen_wrapper.toxcore_enums_and_consts as enums
from tox_wrapper.tox import Tox, UINT32_MAX, ToxError from toxygen_wrapper.tox import Tox, UINT32_MAX, ToxError
from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, from toxygen_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE,
TOX_CONNECTION, TOX_CONNECTION,
TOX_FILE_CONTROL, TOX_FILE_CONTROL,
TOX_MESSAGE_TYPE, TOX_MESSAGE_TYPE,
@ -99,8 +99,8 @@ try:
import support_testing as ts import support_testing as ts
import support_onions as so import support_onions as so
except ImportError: except ImportError:
import tox_wrapper.tests.support_testing as ts import toxygen_wrapper.tests.support_testing as ts
import tox_wrapper.tests.support_onions as so import toxygen_wrapper.tests.support_onions as so
from wrapper_mixin import WrapperMixin from wrapper_mixin import WrapperMixin
@ -1609,7 +1609,7 @@ def iMain(oArgs, failfast=True) -> int:
def oTestsToxOptions(oArgs): def oTestsToxOptions(oArgs):
data = None data = None
tox_options = tox_wrapper.tox.Tox.options_new() tox_options = toxygen_wrapper.tox.Tox.options_new()
if oArgs.proxy_type: if oArgs.proxy_type:
tox_options.contents.proxy_type = int(oArgs.proxy_type) tox_options.contents.proxy_type = int(oArgs.proxy_type)
tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8') tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8')

View File

@ -10,10 +10,10 @@ import threading
from ctypes import * from ctypes import *
from typing import Union, Callable from typing import Union, Callable
import tox_wrapper.toxcore_enums_and_consts as enums import toxygen_wrapper.toxcore_enums_and_consts as enums
from tox_wrapper.tox import Tox, UINT32_MAX, ToxError 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_FILE_CONTROL,
TOX_MESSAGE_TYPE, TOX_MESSAGE_TYPE,
TOX_SECRET_KEY_SIZE, TOX_SECRET_KEY_SIZE,
@ -22,7 +22,7 @@ from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTI
try: try:
import support_testing as ts import support_testing as ts
except ImportError: except ImportError:
import tox_wrapper.tests.support_testing as ts import toxygen_wrapper.tests.support_testing as ts
sleep = time.sleep sleep = time.sleep
ADDR_SIZE = 38 * 2 ADDR_SIZE = 38 * 2

View File

@ -11,10 +11,10 @@ from datetime import datetime
from typing import Union, Callable from typing import Union, Callable
try: try:
from tox_wrapper.libtox import LibToxCore from toxygen_wrapper.libtox import LibToxCore
from tox_wrapper.toxav import ToxAV from toxygen_wrapper.toxav import ToxAV
from tox_wrapper.toxcore_enums_and_consts import * from toxygen_wrapper.toxcore_enums_and_consts import *
import tox_wrapper.toxcore_enums_and_consts as enum import toxygen_wrapper.toxcore_enums_and_consts as enum
except: except:
from libtox import LibToxCore from libtox import LibToxCore
from toxav import ToxAV 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. 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 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. :param data: Data to be hashed or NULL.

View File

@ -6,8 +6,8 @@ from ctypes import (CFUNCTYPE, POINTER, ArgumentError, byref, c_bool, c_char_p,
from typing import Union, Callable from typing import Union, Callable
try: try:
from tox_wrapper.libtox import LibToxAV from toxygen_wrapper.libtox import LibToxAV
import tox_wrapper.toxav_enums as enum import toxygen_wrapper.toxav_enums as enum
except: except:
from libtox import LibToxAV from libtox import LibToxAV
import toxav_enums as enum import toxav_enums as enum

View File

@ -1,8 +1,8 @@
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*- # -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
try: try:
from tox_wrapper import libtox from toxygen_wrapper import libtox
import tox_wrapper.toxencryptsave_enums_and_consts as enum import toxygen_wrapper.toxencryptsave_enums_and_consts as enum
except: except:
import libtox import libtox
import toxencryptsave_enums_and_consts as enum import toxencryptsave_enums_and_consts as enum

View File

@ -31,14 +31,14 @@ def LOG_info(a): print('INFO_ '+a)
def LOG_debug(a): print('DBUG_ '+a) def LOG_debug(a): print('DBUG_ '+a)
def LOG_trace(a): pass # print('TRAC_ '+a) def LOG_trace(a): pass # print('TRAC_ '+a)
from tox_wrapper import tox from toxygen_wrapper import tox
import tox_wrapper.toxcore_enums_and_consts as enums import toxygen_wrapper.toxcore_enums_and_consts as enums
from tox_wrapper.tox import Tox, UINT32_MAX from toxygen_wrapper.tox import Tox, UINT32_MAX
from tox_wrapper.toxcore_enums_and_consts import TOX_CONNECTION, TOX_USER_STATUS, \ 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 TOX_MESSAGE_TYPE, TOX_PUBLIC_KEY_SIZE, TOX_FILE_CONTROL, TOX_FILE_KIND
import tox_wrapper.tests.support_testing as ts import toxygen_wrapper.tests.support_testing as ts
from tox_wrapper.tests.support_testing import oMainArgparser from toxygen_wrapper.tests.support_testing import oMainArgparser
def sleep(fSec) -> None: def sleep(fSec) -> None:
if 'QtCore' in globals(): if 'QtCore' in globals():