diff --git a/Furious/Frozenlib/Utility.py b/Furious/Frozenlib/Utility.py index 3d15be38..41a6694e 100644 --- a/Furious/Frozenlib/Utility.py +++ b/Furious/Frozenlib/Utility.py @@ -35,6 +35,7 @@ __all__ = [ 'Protocol', 'callRateLimited', 'callOnceOnly', + 'classname', 'isValidIPAddress', 'parseHostPort', 'runExternalCommand', @@ -121,6 +122,10 @@ def callOnceOnly(func): return wrapper +def classname(ob) -> str: + return ob.__class__.__name__ + + @functools.lru_cache(None) def isValidIPAddress(address) -> bool: try: diff --git a/Furious/TrayActions/Import.py b/Furious/TrayActions/Import.py index 7bdd0762..9ee61858 100644 --- a/Furious/TrayActions/Import.py +++ b/Furious/TrayActions/Import.py @@ -281,9 +281,6 @@ class ImportQRCodeOnTheScreenAction(Mixins.CleanupOnExit, AppQAction): except Exception as ex: # Any non-exit exceptions - def classname(ob) -> str: - return ob.__class__.__name__ - logger.error(f'\'{classname(self)}\' is not supported on this platform') self.sct = None diff --git a/Furious/Widget/UserServersQTableWidget.py b/Furious/Widget/UserServersQTableWidget.py index 13a1caf1..e2679368 100644 --- a/Furious/Widget/UserServersQTableWidget.py +++ b/Furious/Widget/UserServersQTableWidget.py @@ -218,9 +218,6 @@ class SubscriptionManager(WebGETManager): except Exception as ex: # Any non-exit exceptions - def classname(ob) -> str: - return ob.__class__.__name__ - logger.error(f'parse share link from \'{webURL}\' failed: {ex}') failureArgs.append({'error': classname(ex), **kwargs}) @@ -314,9 +311,6 @@ class TestPingLatencyWorker(QtCore.QObject, QtCore.QRunnable): except Exception as ex: # Any non-exit exceptions - def classname(ob) -> str: - return ob.__class__.__name__ - self.factory.setExtras('delayResult', classname(ex)) # Extra guard @@ -367,9 +361,6 @@ class TestTcpingLatencyWorker(QtCore.QObject, QtCore.QRunnable): except Exception as ex: # Any non-exit exceptions - def classname(ob) -> str: - return ob.__class__.__name__ - self.factory.setExtras('delayResult', classname(ex)) # Extra guard