diff --git a/README.md b/README.md index fbfe629..f65f32a 100644 --- a/README.md +++ b/README.md @@ -84,4 +84,4 @@ To our point of view, the ability of CTYPEs to follow code in the debugger is a crucial advantage. Work on this project is suspended until the -[MultiDevice](https://git.macaw.me/emdee/tox_profile/wiki/MultiDevice-Announcements-POC) problem is solved. Fork me! +[MultiDevice](https://git.plastiras.org/emdee/tox_profile/wiki/MultiDevice-Announcements-POC) problem is solved. Fork me! diff --git a/wrapper/tox.py b/wrapper/tox.py index 0d7326e..ad51db7 100644 --- a/wrapper/tox.py +++ b/wrapper/tox.py @@ -1938,7 +1938,7 @@ class Tox: byref(error)) if error.value: LOG_ERROR(f"group_join {error.value}") - raise ToxError("group_join {error.value}") + raise ToxError(f"group_join {error.value}") return result def group_reconnect(self, group_number): diff --git a/wrapper_tests/support_testing.py b/wrapper_tests/support_testing.py index 44020a6..ad790e8 100644 --- a/wrapper_tests/support_testing.py +++ b/wrapper_tests/support_testing.py @@ -15,9 +15,6 @@ import unittest from random import Random random = Random() -from PyQt5 import QtCore, QtWidgets -from qtpy.QtWidgets import QApplication - try: import coloredlogs if 'COLOREDLOGS_LEVEL_STYLES' not in os.environ: @@ -107,8 +104,10 @@ lDEAD_BS = [ "tox3.plastiras.org", ] - def assert_main_thread(): + from PyQt5 import QtCore, QtWidgets + from qtpy.QtWidgets import QApplication + # this "instance" method is very useful! app_thread = QtWidgets.QApplication.instance().thread() curr_thread = QtCore.QThread.currentThread() @@ -757,6 +756,24 @@ def bootstrap_tcp(lelts, lToxes): LOG.debug(f'bootstrap_tcp to {host} but not connected') pass +def iNmapInfo(sProt, sHost, sPort, key=None, environ=None, bTest=False): + sFile = os.path.join("/tmp", f"{sHost}.{os.getpid()}.nmap") + if sProt in ['socks', 'socks5', 'tcp4']: + cmd = f"nmap -Pn -n -sT -p T:{sPort} {sHost} | grep /tcp >{sFile}" + else: + cmd = f"nmap -Pn -n -sU -p U:{sPort} {sHost} | grep /tcp >{sFile}" + iRet = os.system(cmd) + LOG.debug(f"iNmapInfo cmd={cmd} {iRet}") + if iRet != 0: + return iRet + assert os.path.exists(sFile), sFile + with open(sFile, 'rt') as oFd: + l = oFd.readlines() + assert len(l) + s = '\n'.join([s.strip() for s in l]) + LOG.debug(f"iNmapInfo: {s}") + return 0 + def bootstrap_iNmapInfo(lElts, oArgs, bIS_LOCAL=False, iNODES=iNODES): if not bIS_LOCAL and not bAreWeConnected(): LOG.warn(f"bootstrap_iNmapInfo not local and NOT CONNECTED") diff --git a/wrapper_tests/tests_wrapper.py b/wrapper_tests/tests_wrapper.py index dafa4d7..2370e5a 100644 --- a/wrapper_tests/tests_wrapper.py +++ b/wrapper_tests/tests_wrapper.py @@ -121,24 +121,6 @@ if not hasattr(unittest, 'skip'): return _wrap1 unittest.skip = unittest_skip -def iNmapInfo(sProt, sHost, sPort, key=None, environ=None, bTest=False): - sFile = os.path.join("/tmp", f"{sHost}.{os.getpid()}.nmap") - if sProt in ['socks', 'socks5', 'tcp4']: - cmd = f"nmap -Pn -n -sT -p T:{sPort} {sHost} | grep /tcp >{sFile}" - else: - cmd = f"nmap -Pn -n -sU -p U:{sPort} {sHost} | grep /tcp >{sFile}" - iRet = os.system(cmd) - LOG.debug(f"iNmapInfo cmd={cmd} {iRet}") - if iRet != 0: - return iRet - assert os.path.exists(sFile), sFile - with open(sFile, 'rt') as oFd: - l = oFd.readlines() - assert len(l) - s = '\n'.join([s.strip() for s in l]) - LOG.debug(f"iNmapInfo: {s}") - return 0 - class ToxOptions(): def __init__(self): self.ipv6_enabled = True