diff --git a/Furious-GUI.py b/Furious-GUI.py index 268ca4c..11ba32a 100644 --- a/Furious-GUI.py +++ b/Furious-GUI.py @@ -17,6 +17,5 @@ from Furious.__main__ import main - if __name__ == '__main__': main() diff --git a/Furious/Core/CoreManager.py b/Furious/Core/CoreManager.py index bf44780..2865b88 100644 --- a/Furious/Core/CoreManager.py +++ b/Furious/Core/CoreManager.py @@ -213,6 +213,7 @@ def getUserTUNSettings(*args, **kwargs): class CoreManager(Mixins.CleanupOnExit): """Coordinate proxy cores, TUN setup, DNS changes, and routing cleanup.""" + def __init__(self, *args, **kwargs): """Initialize the CoreManager.""" super().__init__(*args, **kwargs) diff --git a/Furious/Core/CoreProcessWorker.py b/Furious/Core/CoreProcessWorker.py index 3af121d..43dcd7e 100644 --- a/Furious/Core/CoreProcessWorker.py +++ b/Furious/Core/CoreProcessWorker.py @@ -52,6 +52,7 @@ logger = logging.getLogger(__name__) class CoreProcessState(Enum): """Enumerate core process state.""" + Idle = 'idle' Starting = 'starting' Running = 'running' @@ -63,6 +64,7 @@ class CoreProcessState(Enum): @dataclass class CoreLaunchSpec: """Describe the parameters required by a core launch operation.""" + target: Callable args: Tuple[Any, ...] = field(default_factory=tuple) processKwargs: Dict[str, Any] = field(default_factory=dict) @@ -116,6 +118,7 @@ class CoreLaunchSpec: class MsgQueue(multiprocessing.queues.Queue): """Deliver child-process log messages to Qt callbacks at an adaptive rate.""" + MSG_PRODUCE_THRESHOLD = 1024 OPTIMIZER_MIN_FREQ = 2 OPTIMIZER_MAX_FREQ = 256 @@ -207,6 +210,7 @@ class MsgQueue(multiprocessing.queues.Queue): class CoreProcessMonitor(CoreProcessFactory, ABC): """Track the state and lifetime of a proxy-core child process.""" + StopJoinTimeout = 3 def __init__(self, **kwargs): @@ -292,6 +296,7 @@ class CoreProcessMonitor(CoreProcessFactory, ABC): class CoreProcessWorker(CoreProcessMonitor, ABC): """Run and monitor a proxy core in a child process.""" + def __init__(self, **kwargs): """Initialize the CoreProcessWorker.""" msgCallback = kwargs.pop('msgCallback', None) @@ -415,6 +420,7 @@ class CoreProcessWorker(CoreProcessMonitor, ABC): class ProcessOutputRedirector: """Redirect child-process output into the application message queue.""" + TemporaryDir = QtCore.QTemporaryDir() @staticmethod diff --git a/Furious/Core/Hysteria1.py b/Furious/Core/Hysteria1.py index 60c8084..7efebc1 100644 --- a/Furious/Core/Hysteria1.py +++ b/Furious/Core/Hysteria1.py @@ -58,8 +58,10 @@ def startHysteria1(jsonString, rule, mmdb, msgQueue: multiprocessing.Queue): class Hysteria1(CoreProcessWorker): """Manage the embedded Hysteria 1 core subprocess.""" + class ExitCode(Enum): """Enumerate process exit codes.""" + ConfigurationError = 23 RemoteNetworkError = 3 # Windows shutting down diff --git a/Furious/Core/Hysteria2.py b/Furious/Core/Hysteria2.py index c4accf5..ae0d474 100644 --- a/Furious/Core/Hysteria2.py +++ b/Furious/Core/Hysteria2.py @@ -58,8 +58,10 @@ def startHysteria2(jsonString: str, msgQueue: multiprocessing.Queue): class Hysteria2(CoreProcessWorker): """Manage the embedded Hysteria 2 core subprocess.""" + class ExitCode(Enum): """Enumerate process exit codes.""" + ConfigurationError = 23 # Windows: 4294967295. Darwin, Linux: 255 (-1) ServerStartFailure = 4294967295 if PLATFORM == 'Windows' else 255 diff --git a/Furious/Core/Tun2socks.py b/Furious/Core/Tun2socks.py index cd9a676..43f69e9 100644 --- a/Furious/Core/Tun2socks.py +++ b/Furious/Core/Tun2socks.py @@ -52,6 +52,7 @@ def startTun2socks(msgQueue: multiprocessing.Queue, *args): class Tun2socks(CoreProcessWorker): """Manage the tun2socks subprocess used by TUN mode.""" + class ExitCode: # Windows shutting down """Enumerate process exit codes.""" diff --git a/Furious/Core/XrayCore.py b/Furious/Core/XrayCore.py index fa687b7..4d8ace8 100644 --- a/Furious/Core/XrayCore.py +++ b/Furious/Core/XrayCore.py @@ -121,8 +121,10 @@ def startXrayCore(jsonString: str, msgQueue: multiprocessing.Queue): class XrayCore(CoreProcessWorker): """Manage the embedded Xray core subprocess.""" + class ExitCode(Enum): """Enumerate process exit codes.""" + ConfigurationError = 23 # Windows: 4294967295. Darwin, Linux: 255 (-1) ServerStartFailure = 4294967295 if PLATFORM == 'Windows' else 255 diff --git a/Furious/Frozenlib/AppSettings.py b/Furious/Frozenlib/AppSettings.py index 88a9646..272c6d8 100644 --- a/Furious/Frozenlib/AppSettings.py +++ b/Furious/Frozenlib/AppSettings.py @@ -34,6 +34,7 @@ logger = logging.getLogger(__name__) class AppBinarySettings: """Store and validate app binary settings.""" + OFF = '0' ON_ = '1' @@ -42,6 +43,7 @@ class AppBinarySettings: class AppSettings: """Store and validate app settings.""" + SettingsPool: dict[str, AppSettings] = dict() def __init__( diff --git a/Furious/Frozenlib/Enum.py b/Furious/Frozenlib/Enum.py index f61f190..0153429 100644 --- a/Furious/Frozenlib/Enum.py +++ b/Furious/Frozenlib/Enum.py @@ -30,6 +30,7 @@ __all__ = [ class AppBuiltinCommand(Enum): """Enumerate app builtin command.""" + Empty = 'empty' RunAs = 'runas' Clear = 'clear' @@ -37,6 +38,7 @@ class AppBuiltinCommand(Enum): class AppBuiltinRouting(Enum): """Enumerate app builtin routing.""" + BypassMainlandChina = 'Bypass Mainland China' Global = 'Global' Custom = 'Custom' @@ -44,5 +46,6 @@ class AppBuiltinRouting(Enum): class AppBuiltinProxyMode(Enum): """Enumerate app builtin proxy mode.""" + Auto = 'Auto' NoChanges = 'NoChanges' diff --git a/Furious/Frozenlib/Globals.py b/Furious/Frozenlib/Globals.py index 354ce03..137ef31 100644 --- a/Furious/Frozenlib/Globals.py +++ b/Furious/Frozenlib/Globals.py @@ -49,6 +49,7 @@ def getAppAttributes(name: str): class AppLoggerWindow: """Present the app logger window.""" + Self = functools.partial(getAppAttributes, 'logViewerWindowSelf') Core = functools.partial(getAppAttributes, 'logViewerWindowCore') TUN_ = functools.partial(getAppAttributes, 'logViewerWindowTun_') diff --git a/Furious/Frozenlib/Mixins.py b/Furious/Frozenlib/Mixins.py index 7bb963e..75130db 100644 --- a/Furious/Frozenlib/Mixins.py +++ b/Furious/Frozenlib/Mixins.py @@ -34,6 +34,7 @@ __all__ = ['Mixins'] class _WeakObjectsPool: """Store objects in registration order without extending their lifetime.""" + def __init__(self): """Initialize an empty weak object registry.""" self._references = {} @@ -108,6 +109,7 @@ class _WeakObjectsPool: class Mixins: """Group reusable lifecycle, translation, theme, and Qt context mixins.""" + @staticmethod def qObjectIsValid(qobject) -> bool: """Return the q object is valid value used by the mixins.""" @@ -121,6 +123,7 @@ class Mixins: class ConnectionAware: """Represent connection aware.""" + ObjectsPool = _WeakObjectsPool() def __init__(self, *args, **kwargs): @@ -159,6 +162,7 @@ class Mixins: class ThemeAware: """Represent theme aware.""" + ObjectsPool = _WeakObjectsPool() def __init__(self, *args, **kwargs): @@ -203,6 +207,7 @@ class Mixins: class CleanupOnExit: """Represent cleanup on exit.""" + ObjectsPool = _WeakObjectsPool() VisitedType = dict() @@ -243,6 +248,7 @@ class Mixins: class QSetDisabledContext: """Manage the q set disabled context.""" + def __init__(self, qobject: QtCore.QObject): """Initialize the QSetDisabledContext.""" self.qobject = qobject @@ -263,6 +269,7 @@ class Mixins: class QBlockSignalContext: """Manage the q block signal context.""" + def __init__(self, qobject: QtCore.QObject): """Initialize the QBlockSignalContext.""" self.qobject = qobject @@ -283,6 +290,7 @@ class Mixins: class QTranslatable: """Represent q translatable.""" + ObjectsPool = _WeakObjectsPool() def __init__(self, *args, **kwargs): diff --git a/Furious/Frozenlib/PySide6Legacy.py b/Furious/Frozenlib/PySide6Legacy.py index dc4989d..035603d 100644 --- a/Furious/Frozenlib/PySide6Legacy.py +++ b/Furious/Frozenlib/PySide6Legacy.py @@ -30,6 +30,7 @@ __all__ = ['PySide6Legacy'] class PySide6Legacy: """Represent py side6 legacy.""" + @staticmethod def enumValueWrapper(enum) -> int: # Protect PySide6 enum wrapper behavior changes diff --git a/Furious/Frozenlib/StartupOnBoot.py b/Furious/Frozenlib/StartupOnBoot.py index 5a6c692..37045b3 100644 --- a/Furious/Frozenlib/StartupOnBoot.py +++ b/Furious/Frozenlib/StartupOnBoot.py @@ -36,9 +36,11 @@ logger = logging.getLogger(__name__) class StartupOnBoot: """Represent startup on boot.""" + @staticmethod def on_(): """Enable the startup on boot.""" + def _on_(): """Return the on value used by the startup on boot.""" if SystemRuntime.isScriptMode(): @@ -149,6 +151,7 @@ class StartupOnBoot: @staticmethod def off(): """Disable the startup on boot.""" + def _off(): """Return the off value used by the startup on boot.""" if PLATFORM == 'Windows': diff --git a/Furious/Frozenlib/SystemProxy.py b/Furious/Frozenlib/SystemProxy.py index ec20b64..4922747 100644 --- a/Furious/Frozenlib/SystemProxy.py +++ b/Furious/Frozenlib/SystemProxy.py @@ -72,6 +72,7 @@ def linuxProxyConfig(proxy_args, arg0, arg1): def darwinProxyConfig(operation, *args): """Return the darwin proxy config value used by the application.""" + def getNetworkServices(): """Return network services.""" command = runExternalCommand( @@ -99,6 +100,7 @@ def darwinProxyConfig(operation, *args): class _SystemProxy: """Represent system proxy.""" + def __init__(self): """Initialize the _SystemProxy.""" self._daemonThread = None @@ -106,6 +108,7 @@ class _SystemProxy: @staticmethod def pac(pac_url): """Configure the system proxy with a PAC URL.""" + def _pac(): """Return the pac value used by the system proxy.""" if PLATFORM == 'Windows': @@ -152,6 +155,7 @@ class _SystemProxy: @staticmethod def set(server, bypass): """Set data managed by the system proxy.""" + def _set(): """Return the set value used by the system proxy.""" if PLATFORM == 'Windows': @@ -211,6 +215,7 @@ class _SystemProxy: @staticmethod def off(): """Disable the system proxy.""" + def _off(): """Return the off value used by the system proxy.""" if PLATFORM == 'Windows': @@ -257,6 +262,7 @@ class _SystemProxy: def daemonOn_(self): """Return the daemon on value used by the system proxy.""" + def _daemonOn_(): """Return the daemon on value used by the system proxy.""" if PLATFORM == 'Windows': @@ -290,6 +296,7 @@ class _SystemProxy: def daemonOff(self): """Return the daemon off value used by the system proxy.""" + def _daemonOff(): """Return the daemon off value used by the system proxy.""" if PLATFORM == 'Windows': diff --git a/Furious/Frozenlib/SystemRoutingTable.py b/Furious/Frozenlib/SystemRoutingTable.py index 1598a61..d782d47 100644 --- a/Furious/Frozenlib/SystemRoutingTable.py +++ b/Furious/Frozenlib/SystemRoutingTable.py @@ -51,6 +51,7 @@ def dictRepr(returncode, stdout, stderr): class SystemRoutingTable: """Represent system routing table.""" + Relations = list() DEFAULT_GATEWAY_WIN32 = re.compile( @@ -66,6 +67,7 @@ class SystemRoutingTable: @staticmethod def add(sourceIP, destinationIP): """Add the system routing table.""" + def _add(): """Return the add value used by the system routing table.""" if PLATFORM == 'Windows': @@ -256,6 +258,7 @@ class SystemRoutingTable: @staticmethod def DarwinGetDNSServers() -> list: """Return the darwin get DNS servers value.""" + def getNetworkServices(): """Return network services.""" _command = runExternalCommand( @@ -496,6 +499,7 @@ class SystemRoutingTable: @staticmethod def getDefaultGateway() -> list: """Return default gateway.""" + def _get(): """Return the get value used by the system routing table.""" if PLATFORM == 'Windows': @@ -564,6 +568,7 @@ class SystemRoutingTable: @staticmethod def setDeviceGateway(deviceName, deviceIP, deviceGateway): """Set device gateway.""" + def _set(): """Return the set value used by the system routing table.""" if PLATFORM == 'Windows': @@ -625,6 +630,7 @@ class SystemRoutingTable: @staticmethod def delete(sourceIP, destinationIP): """Delete the system routing table.""" + def _delete(): """Return the delete value used by the system routing table.""" if PLATFORM == 'Windows': diff --git a/Furious/Frozenlib/SystemRuntime.py b/Furious/Frozenlib/SystemRuntime.py index 5c50124..712f0d5 100644 --- a/Furious/Frozenlib/SystemRuntime.py +++ b/Furious/Frozenlib/SystemRuntime.py @@ -34,6 +34,7 @@ __all__ = ['SystemRuntime'] class SystemRuntime: """Represent system runtime.""" + @staticmethod @functools.lru_cache(None) def ubuntuRelease() -> str: @@ -124,6 +125,7 @@ class SystemRuntime: @functools.lru_cache(None) def isPythonw() -> bool: """Return whether pythonw.""" + def isRealFile(file): """Return whether real file.""" if not hasattr(file, 'fileno'): diff --git a/Furious/Frozenlib/Utility.py b/Furious/Frozenlib/Utility.py index 215fb5e..765fc08 100644 --- a/Furious/Frozenlib/Utility.py +++ b/Furious/Frozenlib/Utility.py @@ -50,6 +50,7 @@ __all__ = [ class Protocol(Enum): """Enumerate proxy protocols recognized by Furious.""" + Unknown = 'Unknown' VMess = 'VMess' VLESS = 'VLESS' @@ -93,6 +94,7 @@ def callRateLimited(maxCallPerSecond): def decorator(func): """Decorate a callable with the enclosing behavior.""" + @functools.wraps(func) def wrapper(*args, **kwargs): # Previously called @@ -117,8 +119,10 @@ def callRateLimited(maxCallPerSecond): def forceToLocalhostIfPossible(): """Return the force to localhost if possible value used by the application.""" + def decorator(func): """Decorate a callable with the enclosing behavior.""" + @functools.wraps(func) def wrapper(*args, **kwargs): """Invoke the wrapped callable with the enclosing behavior.""" @@ -226,6 +230,7 @@ def absolutePath(path) -> pathlib.Path: @functools.lru_cache(None) def versionToValue(version: str) -> int: """Return the version to value value used by the application.""" + def split(): # x or x.y or x.y.z or x.y.z.u """Split the application.""" diff --git a/Furious/Frozenlib/Win32Session.py b/Furious/Frozenlib/Win32Session.py index 3dfe6ae..eebbdaa 100644 --- a/Furious/Frozenlib/Win32Session.py +++ b/Furious/Frozenlib/Win32Session.py @@ -33,6 +33,7 @@ logger = logging.getLogger(__name__) class _Win32Session: """Represent win32 session.""" + def __init__(self): """Initialize the _Win32Session.""" self._daemonThread = None diff --git a/Furious/Interface/ApplicationFactory.py b/Furious/Interface/ApplicationFactory.py index 0bf69f5..274c371 100644 --- a/Furious/Interface/ApplicationFactory.py +++ b/Furious/Interface/ApplicationFactory.py @@ -26,8 +26,10 @@ __all__ = ['ApplicationFactory'] class ApplicationFactory: """Define the lifecycle contract for the top-level application runner.""" + class ExitCode(Enum): """Enumerate process exit codes.""" + ExitSuccess = 0 UnknownException = 61 PlatformNotSupported = 62 diff --git a/Furious/Interface/CoreProcessFactory.py b/Furious/Interface/CoreProcessFactory.py index 83a56ac..70799fa 100644 --- a/Furious/Interface/CoreProcessFactory.py +++ b/Furious/Interface/CoreProcessFactory.py @@ -34,8 +34,10 @@ __all__ = ['CoreProcessFactory'] class CoreProcessFactory(ABC): """Define the interface and shared behavior for core process objects.""" + class ExitCode(Enum): """Enumerate process exit codes.""" + ConfigurationError = 23 # Windows: 4294967295. Darwin, Linux: 255 (-1) ServerStartFailure = 4294967295 if PLATFORM == 'Windows' else 255 diff --git a/Furious/Interface/EncoderFactory.py b/Furious/Interface/EncoderFactory.py index 1064b95..b5ed212 100644 --- a/Furious/Interface/EncoderFactory.py +++ b/Furious/Interface/EncoderFactory.py @@ -27,6 +27,7 @@ __all__ = ['EncoderFactory'] class EncoderFactory(ABC): """Define the interface and shared behavior for encoder objects.""" + @abstractmethod def encode(self, data: Any, **kwargs) -> Any: """Encode data with the encoder factory.""" diff --git a/Furious/Interface/GuiEditorItemFactory.py b/Furious/Interface/GuiEditorItemFactory.py index 0fc852c..1c5acbb 100644 --- a/Furious/Interface/GuiEditorItemFactory.py +++ b/Furious/Interface/GuiEditorItemFactory.py @@ -26,6 +26,7 @@ __all__ = ['GuiEditorItemFactory', 'GuiEditorItemWidgetContainer'] class GuiEditorItemFactory: """Define the interface and shared behavior for GUI editor item objects.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemFactory.""" super().__init__(*args, **kwargs) @@ -41,6 +42,7 @@ class GuiEditorItemFactory: class GuiEditorItemWidgetContainer(GuiEditorItemFactory): """Bind one or more editor widgets to configuration data.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemWidgetContainer.""" super().__init__(*args, **kwargs) diff --git a/Furious/Interface/StorageFactory.py b/Furious/Interface/StorageFactory.py index d5252fa..a8f0e85 100644 --- a/Furious/Interface/StorageFactory.py +++ b/Furious/Interface/StorageFactory.py @@ -27,6 +27,7 @@ __all__ = ['StorageFactory'] class StorageFactory(ABC): """Define the interface and shared behavior for storage objects.""" + @abstractmethod def sync(self): """Persist the current storage factory data.""" diff --git a/Furious/Interface/UserServersTableItem.py b/Furious/Interface/UserServersTableItem.py index 9ceb165..7d42f47 100644 --- a/Furious/Interface/UserServersTableItem.py +++ b/Furious/Interface/UserServersTableItem.py @@ -24,6 +24,7 @@ __all__ = ['UserServersTableItem'] class UserServersTableItem: """Define the display fields required by a server-table row.""" + def __init__(self, *args, **kwargs): """Initialize the UserServersTableItem.""" super().__init__(*args, **kwargs) diff --git a/Furious/Library/Configuration.py b/Furious/Library/Configuration.py index b17697b..962ad47 100644 --- a/Furious/Library/Configuration.py +++ b/Furious/Library/Configuration.py @@ -61,6 +61,7 @@ __all__ = [ class ConfigXrayProxyOutboundObjectV(dict): """Represent and transform Xray proxy outbound object v configuration data.""" + def __init__( self, protocol, @@ -152,6 +153,7 @@ class ConfigXrayProxyOutboundObjectV(dict): class ConfigXrayProxyOutboundObjectSS(dict): """Represent and transform Xray proxy outbound object ss configuration data.""" + def __init__(self, method, password, address, port): """Initialize the ConfigXrayProxyOutboundObjectSS.""" super().__init__( @@ -183,6 +185,7 @@ class ConfigXrayProxyOutboundObjectSS(dict): class ConfigXrayProxyOutboundObjectSocks(dict): """Represent and transform Xray proxy outbound object SOCKS configuration data.""" + def __init__(self, address, port, user='', password=''): """Initialize the ConfigXrayProxyOutboundObjectSocks.""" settings = { @@ -212,6 +215,7 @@ class ConfigXrayProxyOutboundObjectSocks(dict): class ConfigXrayProxyOutboundObjectTrojan(dict): """Represent and transform Xray proxy outbound object trojan configuration data.""" + def __init__(self, password, address, port, type_, security, **kwargs): """Initialize the ConfigXrayProxyOutboundObjectTrojan.""" networkObjectArgs, securityArgs, TLSObjectArgs = {}, {}, {} @@ -349,6 +353,7 @@ BLANK_CONFIG_XRAY = { class ConfigXray(ConfigFactory): """Represent Xray configuration and supported share-link formats.""" + def __init__(self, config: Union[str, dict] = '', **kwargs): """Initialize the ConfigXray.""" super().__init__(config, **kwargs) @@ -1721,6 +1726,7 @@ BLANK_CONFIG_HYSTERIA1 = { class ConfigHysteria1(ConfigFactory): """Represent Hysteria 1 client configuration and share links.""" + def __init__(self, config: Union[str, dict] = '', **kwargs): """Initialize the ConfigHysteria1.""" super().__init__(config, **kwargs) @@ -2006,6 +2012,7 @@ BLANK_CONFIG_HYSTERIA2 = { class ConfigHysteria2(ConfigFactory): """Represent Hysteria 2 client configuration and share links.""" + def __init__(self, config: Union[str, dict] = '', **kwargs): """Initialize the ConfigHysteria2.""" super().__init__(config, **kwargs) diff --git a/Furious/Library/Encoder.py b/Furious/Library/Encoder.py index f532220..91b9de6 100644 --- a/Furious/Library/Encoder.py +++ b/Furious/Library/Encoder.py @@ -38,6 +38,7 @@ __all__ = [ class JSONEncoder(EncoderFactory): """Encode and decode data using JSON.""" + @staticmethod def encode(data: Any, **kwargs) -> str: """Encode data with the JSON encoder.""" @@ -53,6 +54,7 @@ class JSONEncoder(EncoderFactory): class UJSONEncoder(EncoderFactory): """Encode and decode data using ujson.""" + @staticmethod def encode(data: Any, **kwargs) -> str: """Encode data with the ujson encoder.""" @@ -74,6 +76,7 @@ class UJSONEncoder(EncoderFactory): class Base64Encoder(EncoderFactory): """Encode and decode data using base64.""" + @staticmethod def encode(data: Any, **kwargs) -> bytes: """Encode data with the base64 encoder.""" @@ -89,6 +92,7 @@ class Base64Encoder(EncoderFactory): class PyBase64Encoder(EncoderFactory): """Encode and decode data using py base64.""" + @staticmethod def encode(data: Any, **kwargs) -> bytes: """Encode data with the py base64 encoder.""" diff --git a/Furious/Library/Storage.py b/Furious/Library/Storage.py index e530c1d..2ccc4f1 100644 --- a/Furious/Library/Storage.py +++ b/Furious/Library/Storage.py @@ -35,6 +35,7 @@ __all__ = ['Storage'] class Storage: """Provide cached access to persisted user configuration collections.""" + @staticmethod def UserActivatedItemIndex() -> int: """Return the user activated item index value.""" @@ -79,6 +80,7 @@ class Storage: class Extras: """Derive display and proxy values from the active server.""" + @staticmethod @forceToLocalhostIfPossible() def UserHttpProxy() -> Union[str, None]: diff --git a/Furious/Library/UserRoutings.py b/Furious/Library/UserRoutings.py index 6f6db60..30b1691 100644 --- a/Furious/Library/UserRoutings.py +++ b/Furious/Library/UserRoutings.py @@ -30,6 +30,7 @@ registerAppSettings('CustomRouting') class UserRoutings(Mixins.CleanupOnExit, StorageFactory): """Manage the persisted custom-routing collection.""" + def __init__(self, *args, **kwargs): """Initialize the UserRoutings.""" super().__init__(*args, **kwargs) diff --git a/Furious/Library/UserServers.py b/Furious/Library/UserServers.py index a936e79..8252083 100644 --- a/Furious/Library/UserServers.py +++ b/Furious/Library/UserServers.py @@ -31,6 +31,7 @@ registerAppSettings('Configuration') class UserServer: """Represent user server.""" + remark: str config: str subsId: str @@ -39,6 +40,7 @@ class UserServer: class UserServers(Mixins.CleanupOnExit, StorageFactory): # remark, config, subsId. (subsId corresponds to unique in user subscription) """Manage the persisted list of server configurations.""" + def __init__(self, *args, **kwargs): """Initialize the UserServers.""" super().__init__(*args, **kwargs) diff --git a/Furious/Library/UserSubs.py b/Furious/Library/UserSubs.py index 5763e4a..cbbb80f 100644 --- a/Furious/Library/UserSubs.py +++ b/Furious/Library/UserSubs.py @@ -30,6 +30,7 @@ registerAppSettings('CustomSubscription') class UserSubEntry: """Describe one user sub entry.""" + remark: str webURL: str autoupdate: str @@ -38,12 +39,14 @@ class UserSubEntry: class UserSub: """Represent user sub.""" + unique: dict[str, dict] class UserSubs(Mixins.CleanupOnExit, StorageFactory): # unique: { remark, webURL } """Manage the persisted subscription collection.""" + def __init__(self, *args, **kwargs): """Initialize the UserSubs.""" super().__init__(*args, **kwargs) diff --git a/Furious/Library/UserTUNSettings.py b/Furious/Library/UserTUNSettings.py index e2e19e4..fc59155 100644 --- a/Furious/Library/UserTUNSettings.py +++ b/Furious/Library/UserTUNSettings.py @@ -30,6 +30,7 @@ registerAppSettings('CustomTUNSettings') class UserTUNSettings(Mixins.CleanupOnExit, StorageFactory): """Manage persisted TUN customization values.""" + def __init__(self, *args, **kwargs): """Initialize the UserTUNSettings.""" super().__init__(*args, **kwargs) diff --git a/Furious/Qt/AppStyleSheet.py b/Furious/Qt/AppStyleSheet.py index 47f50f2..d5a64ac 100644 --- a/Furious/Qt/AppStyleSheet.py +++ b/Furious/Qt/AppStyleSheet.py @@ -26,6 +26,7 @@ __all__ = ['AppStyleSheet'] class AppStyleSheet: """Represent app style sheet.""" + Light = 'Light' Dark = 'Dark' FontPointSize = 10 diff --git a/Furious/Qt/DNSResolver.py b/Furious/Qt/DNSResolver.py index 44d5b32..5a58fa0 100644 --- a/Furious/Qt/DNSResolver.py +++ b/Furious/Qt/DNSResolver.py @@ -37,6 +37,7 @@ logger = logging.getLogger(__name__) class _DNSResolver(WebGETManager): """Represent DNS resolver.""" + def __init__(self, parent=None, **kwargs): """Initialize the _DNSResolver.""" actionMessage = kwargs.pop('actionMessage', 'DNS resolution') diff --git a/Furious/Qt/DynamicTheme.py b/Furious/Qt/DynamicTheme.py index 6a16861..87a851c 100644 --- a/Furious/Qt/DynamicTheme.py +++ b/Furious/Qt/DynamicTheme.py @@ -27,8 +27,10 @@ __all__ = ['AppHue'] class AppHue: """Represent app hue.""" + class ColorRGB: """Represent color rgb.""" + LIGHT_BLUE = '#43ACED' LIGHT_RED = '#FF7276' LIGHT_PURPLE = '#DA70D6' diff --git a/Furious/Qt/DynamicTranslate.py b/Furious/Qt/DynamicTranslate.py index 636351d..21fcf73 100644 --- a/Furious/Qt/DynamicTranslate.py +++ b/Furious/Qt/DynamicTranslate.py @@ -32,6 +32,7 @@ __all__ = [ class Translator: """Represent translator.""" + def __init__(self): """Initialize the Translator.""" super().__init__() diff --git a/Furious/Qt/GuiEditorXXX.py b/Furious/Qt/GuiEditorXXX.py index ed3841a..d43a42f 100644 --- a/Furious/Qt/GuiEditorXXX.py +++ b/Furious/Qt/GuiEditorXXX.py @@ -47,6 +47,7 @@ __all__ = [ class GuiEditorItemTextInput(GuiEditorItemWidgetContainer): """Represent GUI editor item text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemTextInput.""" title = kwargs.pop('title', '') @@ -76,6 +77,7 @@ class GuiEditorItemTextInput(GuiEditorItemWidgetContainer): class GuiEditorItemTextSpinBox(GuiEditorItemWidgetContainer): """Represent GUI editor item text spin box.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemTextSpinBox.""" title = kwargs.pop('title', '') @@ -109,6 +111,7 @@ class GuiEditorItemTextSpinBox(GuiEditorItemWidgetContainer): class GuiEditorItemTextComboBox(GuiEditorItemWidgetContainer): """Represent GUI editor item text combo box.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemTextComboBox.""" title = kwargs.pop('title', '') @@ -146,6 +149,7 @@ class GuiEditorItemTextComboBox(GuiEditorItemWidgetContainer): class GuiEditorItemTextCheckBox(GuiEditorItemWidgetContainer): """Represent GUI editor item text check box.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemTextCheckBox.""" title = kwargs.pop('title', '') @@ -171,6 +175,7 @@ class GuiEditorItemTextCheckBox(GuiEditorItemWidgetContainer): class GuiEditorItemBasicRemark(GuiEditorItemTextInput): """Represent GUI editor item basic remark.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemBasicRemark.""" super().__init__(*args, **kwargs) @@ -196,6 +201,7 @@ class GuiEditorItemBasicRemark(GuiEditorItemTextInput): class GuiEditorItemProxyHttp(GuiEditorItemTextInput): """Represent GUI editor item proxy HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemProxyHttp.""" super().__init__(*args, **kwargs) @@ -237,6 +243,7 @@ class GuiEditorItemProxyHttp(GuiEditorItemTextInput): class GuiEditorItemProxySocks(GuiEditorItemTextInput): """Represent GUI editor item proxy SOCKS.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorItemProxySocks.""" super().__init__(*args, **kwargs) @@ -278,6 +285,7 @@ class GuiEditorItemProxySocks(GuiEditorItemTextInput): class GuiEditorWidget(GuiEditorItemFactory): """Provide the GUI editor widget.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorWidget.""" super().__init__(*args, **kwargs) @@ -315,6 +323,7 @@ class GuiEditorWidget(GuiEditorItemFactory): class GuiEditorWidgetQWidget(GuiEditorWidget, QWidget): """Provide the GUI editor Qt widget.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorWidgetQWidget.""" super().__init__(*args, **kwargs) @@ -335,6 +344,7 @@ class GuiEditorWidgetQWidget(GuiEditorWidget, QWidget): class GuiEditorWidgetQGroupBox(GuiEditorWidget, AppQGroupBox): """Group the GUI editor widget q editor controls.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorWidgetQGroupBox.""" super().__init__(*args, **kwargs) @@ -365,6 +375,7 @@ class GuiEditorWidgetQGroupBox(GuiEditorWidget, AppQGroupBox): class GuiEditorWidgetQDialog(GuiEditorItemFactory, AppQDialog): """Present the GUI editor widget Qt dialog.""" + def __init__(self, *args, **kwargs): """Initialize the GuiEditorWidgetQDialog.""" tabText, tabTranslatable, style = ( diff --git a/Furious/Qt/NetworkConnectivityManager.py b/Furious/Qt/NetworkConnectivityManager.py index 33f76ac..042c3db 100644 --- a/Furious/Qt/NetworkConnectivityManager.py +++ b/Furious/Qt/NetworkConnectivityManager.py @@ -35,6 +35,7 @@ logger = logging.getLogger(__name__) class NetworkConnectivityManager(Mixins.ConnectionAware, WebGETManager): """Coordinate network connectivity operations.""" + MIN_JOB_INTERVAL = 2500 MAX_JOB_INTERVAL = 2000000000 diff --git a/Furious/Qt/QtGui.py b/Furious/Qt/QtGui.py index ce7765e..c2e078b 100644 --- a/Furious/Qt/QtGui.py +++ b/Furious/Qt/QtGui.py @@ -44,6 +44,7 @@ __all__ = [ class AppQIcon(QIcon): """Represent app q icon.""" + def __init__(self, iconFileName: str): """Initialize the AppQIcon.""" super().__init__(iconFileName) @@ -112,6 +113,7 @@ def bootstrapIconWithOpacity(name, opacity, isMask=False): class AppQAction(Mixins.QTranslatable, Mixins.ThemeAware, QAction): """Handle the app q action.""" + def __init__( self, text, @@ -271,6 +273,7 @@ class AppQAction(Mixins.QTranslatable, Mixins.ThemeAware, QAction): def retranslate(self): """Refresh translated text for the app q action.""" + def recursiveTranslate(action, memo): """Handle recursive translate for the app q action.""" if action not in memo and not action.isSeparator() and action.translatable: @@ -296,6 +299,7 @@ class AppQAction(Mixins.QTranslatable, Mixins.ThemeAware, QAction): class AppQActionGroup(QActionGroup): """Represent app q action group.""" + def __init__(self, parent, *actions): """Initialize the AppQActionGroup.""" super().__init__(parent) @@ -306,6 +310,7 @@ class AppQActionGroup(QActionGroup): class AppQSeperator(QAction): """Represent app q seperator.""" + def __init__(self): """Initialize the AppQSeperator.""" super().__init__() diff --git a/Furious/Qt/QtNetwork.py b/Furious/Qt/QtNetwork.py index b585738..dca6e20 100644 --- a/Furious/Qt/QtNetwork.py +++ b/Furious/Qt/QtNetwork.py @@ -30,6 +30,7 @@ __all__ = ['AppQNetworkAccessManager'] class AppQNetworkAccessManager(QNetworkAccessManager): """Coordinate app q network access operations.""" + def __init__(self, parent=None): """Initialize the AppQNetworkAccessManager.""" super().__init__(parent) diff --git a/Furious/Qt/QtWidgets.py b/Furious/Qt/QtWidgets.py index 1c24582..2e1276b 100644 --- a/Furious/Qt/QtWidgets.py +++ b/Furious/Qt/QtWidgets.py @@ -80,6 +80,7 @@ def _retainOpenDialog(dialog): if not getattr(dialog, '_furiousOpenDialogLifetimeConnected', False): release = functools.partial(_releaseOpenDialog, key) + dialog.finished.connect(release) dialog.destroyed.connect(release) dialog._furiousOpenDialogLifetimeConnected = True @@ -107,6 +108,7 @@ def moveToCenter(widget, parent=None): class AppQCheckBox(Mixins.QTranslatable, QCheckBox): """Represent app q check box.""" + def __init__(self, *args, **kwargs): """Initialize the AppQCheckBox.""" super().__init__(*args, **kwargs) @@ -118,6 +120,7 @@ class AppQCheckBox(Mixins.QTranslatable, QCheckBox): class AppQComboBox(Mixins.QTranslatable, QComboBox): """Represent app q combo box.""" + def __init__(self, *args, **kwargs): """Initialize the AppQComboBox.""" super().__init__(*args, **kwargs) @@ -130,6 +133,7 @@ class AppQComboBox(Mixins.QTranslatable, QComboBox): class AppQDialog(Mixins.QTranslatable, Mixins.ConnectionAware, QDialog): """Present the app Qt dialog.""" + def __init__(self, *args, **kwargs): """Initialize the AppQDialog.""" super().__init__(*args, **kwargs) @@ -191,6 +195,7 @@ class AppQDialog(Mixins.QTranslatable, Mixins.ConnectionAware, QDialog): class AppQDialogButtonBox(Mixins.QTranslatable, QDialogButtonBox): """Represent app Qt dialog button box.""" + def __init__(self, *args, **kwargs): """Initialize the AppQDialogButtonBox.""" super().__init__(*args, **kwargs) @@ -203,6 +208,7 @@ class AppQDialogButtonBox(Mixins.QTranslatable, QDialogButtonBox): class AppQGroupBox(Mixins.QTranslatable, QGroupBox): """Group the app q editor controls.""" + def __init__(self, *args, **kwargs): """Initialize the AppQGroupBox.""" super().__init__(*args, **kwargs) @@ -214,6 +220,7 @@ class AppQGroupBox(Mixins.QTranslatable, QGroupBox): class AppQHeaderView(Mixins.CleanupOnExit, Mixins.ConnectionAware, QHeaderView): """Represent app q header view.""" + def sectionSizeSettingsEmpty(self): """Return the section size settings empty value used by the app q header view.""" return ( @@ -342,6 +349,7 @@ class AppQHeaderView(Mixins.CleanupOnExit, Mixins.ConnectionAware, QHeaderView): class AppQLabel(Mixins.QTranslatable, QLabel): """Represent app q label.""" + def __init__(self, *args, **kwargs): """Initialize the AppQLabel.""" super().__init__(*args, **kwargs) @@ -353,6 +361,7 @@ class AppQLabel(Mixins.QTranslatable, QLabel): class AppQLineEdit(Mixins.QTranslatable, QLineEdit): """Represent app q line edit.""" + def __init__(self, *args, **kwargs): """Initialize the AppQLineEdit.""" super().__init__(*args, **kwargs) @@ -364,6 +373,7 @@ class AppQLineEdit(Mixins.QTranslatable, QLineEdit): class AppQListWidget(Mixins.ConnectionAware, QListWidget): """Provide the app Qt list widget.""" + def __init__(self, *args, **kwargs): """Initialize the AppQListWidget.""" super().__init__(*args, **kwargs) @@ -407,6 +417,7 @@ class AppQMainWindow( QMainWindow, ): """Present the app q main window.""" + def __init__(self, *args, **kwargs): """Initialize the AppQMainWindow.""" super().__init__(*args, **kwargs) @@ -462,6 +473,7 @@ class AppQMainWindow( class AppQMenu(Mixins.QTranslatable, QMenu): """Represent app q menu.""" + def __init__(self, *actions, **kwargs): """Initialize the AppQMenu.""" super().__init__(**kwargs) @@ -489,6 +501,7 @@ class AppQMenu(Mixins.QTranslatable, QMenu): class AppQMenuBar(QMenuBar): """Represent app q menu bar.""" + def __init__(self, *args, **kwargs): """Initialize the AppQMenuBar.""" super().__init__(*args, **kwargs) @@ -496,6 +509,7 @@ class AppQMenuBar(QMenuBar): class AppQMessageBox(Mixins.QTranslatable, Mixins.ConnectionAware, QMessageBox): """Represent app q message box.""" + def __init__(self, *args, **kwargs): """Initialize the AppQMessageBox.""" super().__init__(*args, **kwargs) @@ -564,6 +578,7 @@ class AppQMessageBox(Mixins.QTranslatable, Mixins.ConnectionAware, QMessageBox): class AppQPushButton(Mixins.QTranslatable, Mixins.ThemeAware, QPushButton): """Represent app q push button.""" + def __init__(self, *args, **kwargs): """Initialize the AppQPushButton.""" icon = kwargs.pop('icon', None) @@ -633,6 +648,7 @@ class AppQPushButton(Mixins.QTranslatable, Mixins.ThemeAware, QPushButton): class AppQSpinBox(QSpinBox): """Represent app q spin box.""" + def __init__(self, *args, **kwargs): """Initialize the AppQSpinBox.""" super().__init__(*args, **kwargs) @@ -655,6 +671,7 @@ class AppQSpinBox(QSpinBox): class AppQTableView(Mixins.ConnectionAware, QTableView): """Represent app Qt table view.""" + def __init__(self, *args, **kwargs): """Initialize the AppQTableView.""" super().__init__(*args, **kwargs) @@ -689,6 +706,7 @@ class AppQTableView(Mixins.ConnectionAware, QTableView): class AppQTableWidget(Mixins.ConnectionAware, QTableWidget): """Provide the app Qt table widget.""" + def __init__(self, *args, **kwargs): """Initialize the AppQTableWidget.""" super().__init__(*args, **kwargs) @@ -769,6 +787,7 @@ class AppQTableWidget(Mixins.ConnectionAware, QTableWidget): class AppQTabWidget(Mixins.QTranslatable, QTabWidget): """Provide the app q tab widget.""" + def __init__(self, *args, **kwargs): """Initialize the AppQTabWidget.""" super().__init__(*args, **kwargs) @@ -781,6 +800,7 @@ class AppQTabWidget(Mixins.QTranslatable, QTabWidget): class AppQToolBar(Mixins.QTranslatable, QToolBar): """Represent app q tool bar.""" + def __init__(self, *actions, **kwargs): """Initialize the AppQToolBar.""" super().__init__(**kwargs) @@ -805,6 +825,7 @@ class AppQToolBar(Mixins.QTranslatable, QToolBar): @QtCore.Slot(AppQAction) def showMenuBelow(self, action: AppQAction): """Show menu below.""" + def toolBarWidgetForAction() -> Union[QWidget | None]: # Walk through the toolbar to find the widget for the action """Return the tool bar widget for action value used by the app q tool bar.""" @@ -838,6 +859,7 @@ class AppQToolBar(Mixins.QTranslatable, QToolBar): class MBoxQuestionDelete(AppQMessageBox): """Represent m box question delete.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxQuestionDelete.""" super().__init__(*args, **kwargs) @@ -869,6 +891,7 @@ class MBoxQuestionDelete(AppQMessageBox): class MBoxNewChangesNextTime(AppQMessageBox): """Represent m box new changes next time.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxNewChangesNextTime.""" super().__init__(*args, **kwargs) @@ -898,8 +921,8 @@ class MBoxNewChangesNextTime(AppQMessageBox): def showMBoxNewChangesNextTime(**kwargs): - """Show m box new changes next time.""" + @QtCore.Slot(int) def handleResultCode(code): """Handle result code.""" @@ -935,6 +958,7 @@ def showMBoxNewChangesNextTime(**kwargs): class MBoxDirectRulesNotAllowed(AppQMessageBox): """Represent m box direct rules not allowed.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxDirectRulesNotAllowed.""" super().__init__(*args, **kwargs) @@ -967,6 +991,7 @@ class MBoxDirectRulesNotAllowed(AppQMessageBox): def showMBoxDirectRulesNotAllowed(**kwargs): """Show m box direct rules not allowed.""" + @QtCore.Slot(int) def handleResultCode(code): """Handle result code.""" @@ -991,6 +1016,7 @@ def showMBoxDirectRulesNotAllowed(**kwargs): class MBoxUnrecognizedConfig(AppQMessageBox): """Represent m box unrecognized config.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxUnrecognizedConfig.""" super().__init__(*args, **kwargs) diff --git a/Furious/Qt/TextEditor.py b/Furious/Qt/TextEditor.py index 8565087..b24d64c 100644 --- a/Furious/Qt/TextEditor.py +++ b/Furious/Qt/TextEditor.py @@ -41,6 +41,7 @@ __all__ = [ class SupportPointSizeSettings(Mixins.CleanupOnExit): """Store and validate support point size settings.""" + def pointSizeSettingsEmpty(self): """Return the point size settings empty value used by the support point size settings.""" return self.pointSizeSettingsName == '' @@ -66,6 +67,7 @@ class SupportPointSizeSettings(Mixins.CleanupOnExit): class AppQPlainTextEdit(SupportPointSizeSettings, QPlainTextEdit): """Represent app q plain text edit.""" + def __init__(self, *args, **kwargs): """Initialize the AppQPlainTextEdit.""" super().__init__(*args, **kwargs) @@ -231,6 +233,7 @@ class AppQPlainTextEdit(SupportPointSizeSettings, QPlainTextEdit): class AppQTextBrowser(SupportPointSizeSettings, QTextBrowser): """Represent app q text browser.""" + def __init__(self, *args, **kwargs): """Initialize the AppQTextBrowser.""" super().__init__(*args, **kwargs) @@ -286,6 +289,7 @@ class AppQTextBrowser(SupportPointSizeSettings, QTextBrowser): class DraculaTextEditor(AppQPlainTextEdit): """Represent dracula text editor.""" + def __init__(self, *args, **kwargs): """Initialize the DraculaTextEditor.""" fontFamily = kwargs.pop('fontFamily', '') @@ -331,6 +335,7 @@ class DraculaTextEditor(AppQPlainTextEdit): class DraculaJSONTextEditor(DraculaTextEditor): """Represent dracula JSON text editor.""" + def __init__(self, *args, **kwargs): """Initialize the DraculaJSONTextEditor.""" super().__init__(*args, **kwargs) @@ -340,6 +345,7 @@ class DraculaJSONTextEditor(DraculaTextEditor): class DraculaTextBrowser(AppQTextBrowser): """Represent dracula text browser.""" + def __init__(self, *args, **kwargs): """Initialize the DraculaTextBrowser.""" fontFamily = kwargs.pop('fontFamily', '') diff --git a/Furious/Qt/TextEditorTheme.py b/Furious/Qt/TextEditorTheme.py index ecb0a94..0085727 100644 --- a/Furious/Qt/TextEditorTheme.py +++ b/Furious/Qt/TextEditorTheme.py @@ -33,6 +33,7 @@ __all__ = [ class EditorHighlightRules: """Represent editor highlight rules.""" + def __init__(self, regex, color, isBold=False, isItalic=False, isJSONKey=False): """Initialize the EditorHighlightRules.""" self.regex = QtCore.QRegularExpression(regex) @@ -52,6 +53,7 @@ class EditorHighlightRules: class EditorTheme: """Represent editor theme.""" + def __init__(self, *args, **kwargs): """Initialize the EditorTheme.""" super().__init__(*args, **kwargs) @@ -64,6 +66,7 @@ class EditorTheme: class DraculaEditorTheme(EditorTheme): """Represent dracula editor theme.""" + def __init__(self, *args, **kwargs): """Initialize the DraculaEditorTheme.""" super().__init__(*args, **kwargs) @@ -82,6 +85,7 @@ class DraculaEditorTheme(EditorTheme): class AppQSyntaxHighlighter(QSyntaxHighlighter): """Apply syntax highlighting for app q syntax text.""" + def __init__(self, *args, **kwargs): """Initialize the AppQSyntaxHighlighter.""" super().__init__(*args, **kwargs) @@ -124,6 +128,7 @@ class AppQSyntaxHighlighter(QSyntaxHighlighter): class DraculaJSONSyntaxHighlighter(AppQSyntaxHighlighter): """Apply syntax highlighting for dracula JSON syntax text.""" + def __init__(self, *args, **kwargs): """Initialize the DraculaJSONSyntaxHighlighter.""" super().__init__(*args, **kwargs) diff --git a/Furious/Qt/UpdatesManager.py b/Furious/Qt/UpdatesManager.py index 8670b3d..9e1c60d 100644 --- a/Furious/Qt/UpdatesManager.py +++ b/Furious/Qt/UpdatesManager.py @@ -40,6 +40,7 @@ logger = logging.getLogger(__name__) class MBoxQuestionUpdate(AppQMessageBox): """Represent m box question update.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxQuestionUpdate.""" super().__init__(*args, **kwargs) @@ -67,6 +68,7 @@ class MBoxQuestionUpdate(AppQMessageBox): class UpdatesManager(WebGETManager): """Coordinate updates operations.""" + API_URL = ( f'https://api.github.com/repos/' f'{APPLICATION_REPO_OWNER_NAME}/{APPLICATION_REPO_NAME}/releases/latest' diff --git a/Furious/Qt/WebGETManager.py b/Furious/Qt/WebGETManager.py index 2d78e0e..5862b75 100644 --- a/Furious/Qt/WebGETManager.py +++ b/Furious/Qt/WebGETManager.py @@ -37,6 +37,7 @@ logger = logging.getLogger(__name__) class WebGETManager(AppQNetworkAccessManager): """Coordinate web get operations.""" + def __init__(self, parent=None, actionMessage='web GET', **kwargs): """Initialize the WebGETManager.""" super().__init__(parent) @@ -64,6 +65,7 @@ class WebGETManager(AppQNetworkAccessManager): def must(self, **kwargs): """Run the required completion hook according to its call policy.""" + def call(): """Invoke the registered completion callback.""" try: diff --git a/Furious/Qt/XrayAssetDownloadManager.py b/Furious/Qt/XrayAssetDownloadManager.py index 75ec355..0006005 100644 --- a/Furious/Qt/XrayAssetDownloadManager.py +++ b/Furious/Qt/XrayAssetDownloadManager.py @@ -38,6 +38,7 @@ logger = logging.getLogger(__name__) class SHA256Worker(QtCore.QObject, QtCore.QRunnable): """Run SHA-256 work in the background.""" + finished = QtCore.Signal(str) def __init__(self, string=b''): @@ -55,6 +56,7 @@ class SHA256Worker(QtCore.QObject, QtCore.QRunnable): class XrayAssetSHA256DownloadManager(WebGETManager): """Coordinate Xray asset SHA-256 download operations.""" + def __init__(self, parent=None, **kwargs): """Initialize the XrayAssetSHA256DownloadManager.""" actionMessage = kwargs.pop('actionMessage', 'download sha256') @@ -124,6 +126,7 @@ class XrayAssetSHA256DownloadManager(WebGETManager): class XrayAssetAssetsDownloadManager(WebGETManager): """Coordinate Xray asset assets download operations.""" + def __init__(self, parent=None, **kwargs): """Initialize the XrayAssetAssetsDownloadManager.""" actionMessage = kwargs.pop('actionMessage', 'download assets') @@ -159,6 +162,7 @@ class XrayAssetAssetsDownloadManager(WebGETManager): class XrayAssetPairDownloadHelper: """Represent Xray asset pair download helper.""" + def __init__(self, *args, **kwargs): """Initialize the XrayAssetPairDownloadHelper.""" sha256ActionMessage = kwargs.pop('sha256ActionMessage', 'download sha256') @@ -195,6 +199,7 @@ class XrayAssetPairDownloadHelper: class XrayAssetDownloadManager: """Coordinate Xray asset download operations.""" + def __init__(self, *args, **kwargs): """Initialize the XrayAssetDownloadManager.""" super().__init__(*args, **kwargs) diff --git a/Furious/TrayActions/Connect.py b/Furious/TrayActions/Connect.py index 9277b55..8a54838 100644 --- a/Furious/TrayActions/Connect.py +++ b/Furious/TrayActions/Connect.py @@ -57,6 +57,7 @@ def validateProxyServer(server) -> bool: class ConnectAction(AppQAction): """Handle the connect action.""" + def __init__(self, **kwargs): """Initialize the ConnectAction.""" super().__init__( @@ -323,6 +324,7 @@ class ConnectAction(AppQAction): @callOnceOnly def doConnectedCallOnceOnly(self): """Handle do connected call once only for the connect action.""" + def newVersionCallback(newVersion): """Handle the new version callback.""" APP().systemTray.showMessage( @@ -370,6 +372,7 @@ class ConnectAction(AppQAction): def coreExitCallback(self, core: CoreProcessFactory, exitcode: int): """Handle the core exit callback.""" + def putItem(item): """Handle put item for the connect action.""" try: diff --git a/Furious/TrayActions/EditConfiguration.py b/Furious/TrayActions/EditConfiguration.py index 7492950..ab61b4a 100644 --- a/Furious/TrayActions/EditConfiguration.py +++ b/Furious/TrayActions/EditConfiguration.py @@ -28,6 +28,7 @@ __all__ = ['EditConfigurationAction'] class EditConfigurationAction(AppQAction): """Handle the edit configuration action.""" + def __init__(self, **kwargs): """Initialize the EditConfigurationAction.""" super().__init__( diff --git a/Furious/TrayActions/Exit.py b/Furious/TrayActions/Exit.py index ce9dd3a..a093dcf 100644 --- a/Furious/TrayActions/Exit.py +++ b/Furious/TrayActions/Exit.py @@ -28,6 +28,7 @@ __all__ = ['ExitAction'] class ExitAction(AppQAction): """Handle the exit action.""" + def __init__(self, **kwargs): """Initialize the ExitAction.""" super().__init__( diff --git a/Furious/TrayActions/Import.py b/Furious/TrayActions/Import.py index 721a523..ed67ef0 100644 --- a/Furious/TrayActions/Import.py +++ b/Furious/TrayActions/Import.py @@ -130,6 +130,7 @@ def importURIs(*uris, failureCallback: Union[Callable[[], None], None] = None): class ImportURIsProgressDialog(AppQDialog): """Present progress and cancellation controls for import ur is.""" + ActiveDialogs = list() def __init__( @@ -304,6 +305,7 @@ class ImportURIsProgressDialog(AppQDialog): class MBoxImportError(AppQMessageBox): """Represent m box import error.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxImportError.""" super().__init__(*args, **kwargs) @@ -322,6 +324,7 @@ class MBoxImportError(AppQMessageBox): class MBoxImportMultiSuccess(AppQMessageBox): """Represent m box import multi success.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxImportMultiSuccess.""" super().__init__(*args, **kwargs) @@ -365,6 +368,7 @@ class MBoxImportMultiSuccess(AppQMessageBox): class MBoxImportSuccess(AppQMessageBox): """Represent m box import success.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxImportSuccess.""" super().__init__(*args, **kwargs) @@ -391,6 +395,7 @@ class MBoxImportSuccess(AppQMessageBox): class ImportFromFileAction(AppQAction): """Handle the import from file action.""" + def __init__(self, **kwargs): """Initialize the ImportFromFileAction.""" super().__init__( @@ -446,6 +451,7 @@ class ImportFromFileAction(AppQAction): class ImportURIFromClipboardAction(AppQAction): """Handle the import URI from clipboard action.""" + def __init__(self, **kwargs): """Initialize the ImportURIFromClipboardAction.""" super().__init__(_('Import Share Link From Clipboard'), **kwargs) @@ -469,6 +475,7 @@ class ImportURIFromClipboardAction(AppQAction): class ImportJSONFromClipboardAction(AppQAction): """Handle the import JSON from clipboard action.""" + def __init__(self, **kwargs): """Initialize the ImportJSONFromClipboardAction.""" super().__init__(_('Import JSON Configuration From Clipboard'), **kwargs) @@ -482,6 +489,7 @@ class ImportJSONFromClipboardAction(AppQAction): class ImportQRCodeOnTheScreenAction(Mixins.CleanupOnExit, AppQAction): """Handle the import QR code on the screen action.""" + def __init__(self, **kwargs): """Initialize the ImportQRCodeOnTheScreenAction.""" super().__init__( @@ -547,6 +555,7 @@ class ImportQRCodeOnTheScreenAction(Mixins.CleanupOnExit, AppQAction): class ImportAction(AppQAction): """Handle the import action.""" + def __init__(self, **kwargs): """Initialize the ImportAction.""" super().__init__( diff --git a/Furious/TrayActions/Language.py b/Furious/TrayActions/Language.py index e0f9393..5138ecf 100644 --- a/Furious/TrayActions/Language.py +++ b/Furious/TrayActions/Language.py @@ -41,6 +41,7 @@ registerAppSettings( class LanguageChildAction(AppQAction): """Handle the language child action.""" + def __init__(self, *args, **kwargs): """Initialize the LanguageChildAction.""" super().__init__(*args, **kwargs) @@ -64,6 +65,7 @@ class LanguageChildAction(AppQAction): class LanguageAction(AppQAction): """Handle the language action.""" + def __init__(self, **kwargs): """Initialize the LanguageAction.""" super().__init__( diff --git a/Furious/TrayActions/Routing.py b/Furious/TrayActions/Routing.py index d47c9cf..1f24dad 100644 --- a/Furious/TrayActions/Routing.py +++ b/Furious/TrayActions/Routing.py @@ -38,6 +38,7 @@ _TRANSLATABLE_BUILTIN_ROUTING = [ class RoutingChildAction(AppQAction): """Handle the routing child action.""" + def __init__(self, *args, **kwargs): """Initialize the RoutingChildAction.""" self.routingValue = kwargs.pop('routingValue', None) @@ -57,6 +58,7 @@ class RoutingChildAction(AppQAction): class RoutingAction(AppQAction): """Handle the routing action.""" + def __init__(self, **kwargs): """Initialize the RoutingAction.""" if AppSettings.get('Routing') == 'Bypass': diff --git a/Furious/TrayActions/Settings.py b/Furious/TrayActions/Settings.py index b9bc28c..1deee6d 100644 --- a/Furious/TrayActions/Settings.py +++ b/Furious/TrayActions/Settings.py @@ -56,6 +56,7 @@ _TRANSLATABLE_TUN_MODE = [ class TUNModeAction(AppQAction): """Handle the TUN mode action.""" + def __init__(self, **kwargs): """Initialize the TUNModeAction.""" if PLATFORM == 'Linux': @@ -85,6 +86,7 @@ class TUNModeAction(AppQAction): class SettingsChildAction(AppQAction): """Handle the settings child action.""" + def __init__(self, *args, **kwargs): """Initialize the SettingsChildAction.""" super().__init__(*args, **kwargs) @@ -179,6 +181,7 @@ class SettingsChildAction(AppQAction): class SettingsAction(AppQAction): """Handle the settings action.""" + def __init__(self, **kwargs): """Initialize the SettingsAction.""" if SystemRuntime.flatpakID(): diff --git a/Furious/TrayActions/SystemProxy.py b/Furious/TrayActions/SystemProxy.py index 62bc1bb..acb9c87 100644 --- a/Furious/TrayActions/SystemProxy.py +++ b/Furious/TrayActions/SystemProxy.py @@ -32,6 +32,7 @@ registerAppSettings( class SystemProxyChildAction(AppQAction): """Handle the system proxy child action.""" + def __init__(self, *args, **kwargs): """Initialize the SystemProxyChildAction.""" super().__init__(*args, **kwargs) @@ -46,6 +47,7 @@ class SystemProxyChildAction(AppQAction): class SystemProxyAction(AppQAction): """Handle the system proxy action.""" + def __init__(self, **kwargs): """Initialize the SystemProxyAction.""" super().__init__( diff --git a/Furious/Utility/AppMainProcess.py b/Furious/Utility/AppMainProcess.py index 2153fed..2dab7ae 100644 --- a/Furious/Utility/AppMainProcess.py +++ b/Furious/Utility/AppMainProcess.py @@ -46,6 +46,7 @@ else: class AppMainProcess(ProcessContext.Process): """Represent app main process.""" + def __init__(self, func: Callable[[], ApplicationFactory], **kwargs): """Initialize the AppMainProcess.""" super().__init__(**kwargs) diff --git a/Furious/Widget/Application.py b/Furious/Widget/Application.py index 97fe83c..6ac88bc 100644 --- a/Furious/Widget/Application.py +++ b/Furious/Widget/Application.py @@ -51,11 +51,13 @@ registerAppSettings('LogViewerWidgetPointSizeTun_') class SystemTrayUnavailable(Exception): """Represent system tray unavailable.""" + pass class AppLogHandler(logging.Handler): """Represent app log handler.""" + def __init__(self, emitCallback): """Initialize the AppLogHandler.""" super().__init__() @@ -70,6 +72,7 @@ class AppLogHandler(logging.Handler): class ApplicationExitHelper(QApplication): """Represent application exit helper.""" + def __init__(self, argv): """Initialize the ApplicationExitHelper.""" super().__init__(argv) @@ -88,6 +91,7 @@ class ApplicationExitHelper(QApplication): class SingletonApplication(ApplicationExitHelper): """Represent singleton application.""" + def __init__(self, argv): """Initialize the SingletonApplication.""" super().__init__(argv) @@ -153,6 +157,7 @@ class SingletonApplication(ApplicationExitHelper): class ApplicationThemeDetector(QtCore.QObject): """Represent application theme detector.""" + themeChanged = QtCore.Signal(str) def __init__(self, *args, **kwargs): @@ -162,6 +167,7 @@ class ApplicationThemeDetector(QtCore.QObject): class Application(ApplicationFactory, SingletonApplication): """Represent application.""" + def __init__(self, argv): """Initialize the Application.""" super().__init__(argv) diff --git a/Furious/Widget/ConnectProgressBar.py b/Furious/Widget/ConnectProgressBar.py index 63deae6..0d02601 100644 --- a/Furious/Widget/ConnectProgressBar.py +++ b/Furious/Widget/ConnectProgressBar.py @@ -31,6 +31,7 @@ __all__ = ['ConnectProgressBar'] class AutoUpdateProgressBar(Mixins.ConnectionAware, QProgressBar): """Represent auto update progress bar.""" + def __init__(self, **kwargs): """Initialize the AutoUpdateProgressBar.""" super().__init__(**kwargs) @@ -91,6 +92,7 @@ class AutoUpdateProgressBar(Mixins.ConnectionAware, QProgressBar): class ConnectProgressBar(Mixins.QTranslatable, Mixins.ConnectionAware, QWidget): """Provide the connect progress bar widget.""" + def __init__(self, parent=None): """Initialize the ConnectProgressBar.""" super().__init__(parent) diff --git a/Furious/Widget/GuiCustomizeNetworkTest.py b/Furious/Widget/GuiCustomizeNetworkTest.py index 7962f74..f288a93 100644 --- a/Furious/Widget/GuiCustomizeNetworkTest.py +++ b/Furious/Widget/GuiCustomizeNetworkTest.py @@ -39,6 +39,7 @@ registerAppSettings('CustomNetworkConnectivityTestURL') class GuiCustomizeNetworkTestDialog(AppQDialog): """Present the GUI customize network test dialog.""" + def __init__(self, *args, **kwargs): """Initialize the GuiCustomizeNetworkTestDialog.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiCustomizeProxyBypass.py b/Furious/Widget/GuiCustomizeProxyBypass.py index a177ad6..dbfbf4f 100644 --- a/Furious/Widget/GuiCustomizeProxyBypass.py +++ b/Furious/Widget/GuiCustomizeProxyBypass.py @@ -38,6 +38,7 @@ registerAppSettings('CustomProxyBypass') class GuiCustomizeProxyBypassDialog(AppQDialog): """Present the GUI customize proxy bypass dialog.""" + def __init__(self, *args, **kwargs): """Initialize the GuiCustomizeProxyBypassDialog.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiHysteria1.py b/Furious/Widget/GuiHysteria1.py index 65445b1..b2b7513 100644 --- a/Furious/Widget/GuiHysteria1.py +++ b/Furious/Widget/GuiHysteria1.py @@ -38,6 +38,7 @@ logger = logging.getLogger(__name__) class GuiHy1ItemTextInput(GuiEditorItemTextInput): """Represent GUI hy1 item text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ItemTextInput.""" key = kwargs.pop('key', '') @@ -79,6 +80,7 @@ class GuiHy1ItemTextInput(GuiEditorItemTextInput): class GuiHy1ItemBasicProtocol(GuiEditorItemTextComboBox): """Represent GUI hy1 item basic protocol.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ItemBasicProtocol.""" super().__init__(*args, **kwargs) @@ -114,6 +116,7 @@ class GuiHy1ItemBasicProtocol(GuiEditorItemTextComboBox): class GuiHy1ItemSpeedUpMbps(GuiEditorItemTextSpinBox): """Represent GUI hy1 item speed up mbps.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ItemSpeedUpMbps.""" super().__init__(*args, **kwargs) @@ -150,6 +153,7 @@ class GuiHy1ItemSpeedUpMbps(GuiEditorItemTextSpinBox): class GuiHy1ItemSpeedDownMbps(GuiEditorItemTextSpinBox): """Represent GUI hy1 item speed down mbps.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ItemSpeedDownMbps.""" super().__init__(*args, **kwargs) @@ -186,6 +190,7 @@ class GuiHy1ItemSpeedDownMbps(GuiEditorItemTextSpinBox): class GuiHy1ItemTLSInsecure(GuiEditorItemTextCheckBox): """Represent GUI hy1 item TLS insecure.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ItemTLSInsecure.""" super().__init__(*args, **kwargs) @@ -239,6 +244,7 @@ class GuiHy1ItemTLSInsecure(GuiEditorItemTextCheckBox): class GuiHy1ProjectWebsiteURL(AppQLabel): """Represent GUI hy1 project website URL.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy1ProjectWebsiteURL.""" super().__init__(*args, **kwargs) @@ -271,6 +277,7 @@ class GuiHy1ProjectWebsiteURL(AppQLabel): class GuiHy1GroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI hy1 group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiHy1GroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -288,6 +295,7 @@ class GuiHy1GroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiHy1GroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI hy1 group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiHy1GroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -302,6 +310,7 @@ class GuiHy1GroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiHy1GroupBoxSpeed(GuiEditorWidgetQGroupBox): """Represent GUI hy1 group box speed.""" + def __init__(self, **kwargs): """Initialize the GuiHy1GroupBoxSpeed.""" super().__init__(_('Speed'), **kwargs) @@ -316,6 +325,7 @@ class GuiHy1GroupBoxSpeed(GuiEditorWidgetQGroupBox): class GuiHy1GroupBoxTLS(GuiEditorWidgetQGroupBox): """Represent GUI hy1 group box TLS.""" + def __init__(self, **kwargs): """Initialize the GuiHy1GroupBoxTLS.""" super().__init__('TLS', **kwargs) @@ -334,6 +344,7 @@ class GuiHy1GroupBoxTLS(GuiEditorWidgetQGroupBox): class GuiHy1GroupBoxOther(GuiEditorItemFactory, AppQGroupBox): """Represent GUI hy1 group box other.""" + def __init__(self, **kwargs): """Initialize the GuiHy1GroupBoxOther.""" super().__init__(_('Other'), **kwargs) @@ -356,6 +367,7 @@ class GuiHy1GroupBoxOther(GuiEditorItemFactory, AppQGroupBox): class GuiHysteria1(GuiEditorWidgetQDialog): """Represent GUI hysteria1.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHysteria1.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiHysteria2.py b/Furious/Widget/GuiHysteria2.py index c1492aa..76d95bc 100644 --- a/Furious/Widget/GuiHysteria2.py +++ b/Furious/Widget/GuiHysteria2.py @@ -40,6 +40,7 @@ HY2_OBFS_TYPES = ['', 'salamander', 'gecko'] class GuiHy2ItemBasicServer(GuiEditorItemTextInput): """Represent GUI hy2 item basic server.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemBasicServer.""" super().__init__(*args, **kwargs) @@ -73,6 +74,7 @@ class GuiHy2ItemBasicServer(GuiEditorItemTextInput): class GuiHy2ItemBasicAuth(GuiEditorItemTextInput): """Represent GUI hy2 item basic auth.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemBasicAuth.""" super().__init__(*args, **kwargs) @@ -114,6 +116,7 @@ class GuiHy2ItemBasicAuth(GuiEditorItemTextInput): class GuiHy2ItemBasicCongestionComboBox(GuiEditorItemTextComboBox): """Represent GUI hy2 item basic congestion combo box.""" + CONGESTION_KEYS = ['type', 'bbrProfile'] def __init__(self, *args, **kwargs): @@ -205,6 +208,7 @@ class GuiHy2ItemBasicCongestionComboBox(GuiEditorItemTextComboBox): class GuiHy2ItemObfsType(GuiEditorItemTextComboBox): """Represent GUI hy2 item obfs type.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemObfsType.""" super().__init__(*args, **kwargs) @@ -262,6 +266,7 @@ class GuiHy2ItemObfsType(GuiEditorItemTextComboBox): class GuiHy2ItemObfsPassword(GuiEditorItemTextInput): """Represent GUI hy2 item obfs password.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemObfsPassword.""" self.obfsType = kwargs.pop('obfsType', 'salamander') @@ -334,6 +339,7 @@ class GuiHy2ItemObfsPassword(GuiEditorItemTextInput): class GuiHy2ItemObfsPacketSize(GuiEditorItemTextSpinBox): """Represent GUI hy2 item obfs packet size.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemObfsPacketSize.""" self.obfsType, self.key, self.default = ( @@ -404,6 +410,7 @@ class GuiHy2ItemObfsPacketSize(GuiEditorItemTextSpinBox): class GuiHy2PageObfsXXX(GuiEditorWidgetQWidget): """Represent GUI hy2 page obfs xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2PageObfsXXX.""" super().__init__(*args, **kwargs) @@ -425,6 +432,7 @@ class GuiHy2PageObfsXXX(GuiEditorWidgetQWidget): class GuiHy2PageObfsEmpty(GuiHy2PageObfsXXX): """Represent GUI hy2 page obfs empty.""" + def containerSequence(self): """Return the editor item containers in display order.""" return [ @@ -434,6 +442,7 @@ class GuiHy2PageObfsEmpty(GuiHy2PageObfsXXX): class GuiHy2PageObfsSalamander(GuiHy2PageObfsXXX): """Represent GUI hy2 page obfs salamander.""" + def containerSequence(self): """Return the editor item containers in display order.""" return [ @@ -448,6 +457,7 @@ class GuiHy2PageObfsSalamander(GuiHy2PageObfsXXX): class GuiHy2PageObfsGecko(GuiHy2PageObfsXXX): """Represent GUI hy2 page obfs gecko.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2PageObfsGecko.""" super().__init__(*args, **kwargs) @@ -493,6 +503,7 @@ class GuiHy2PageObfsGecko(GuiHy2PageObfsXXX): class GuiHy2ObfsPageStackedWidget(QStackedWidget): """Provide the GUI hy2 obfs page stacked widget.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ObfsPageStackedWidget.""" super().__init__(*args, **kwargs) @@ -518,6 +529,7 @@ class GuiHy2ObfsPageStackedWidget(QStackedWidget): class GuiHy2ItemTLSTextInput(GuiEditorItemTextInput): """Represent GUI hy2 item TLS text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemTLSTextInput.""" key = kwargs.pop('key', '') @@ -597,6 +609,7 @@ class GuiHy2ItemTLSTextInput(GuiEditorItemTextInput): class GuiHy2ItemTLSInsecure(GuiEditorItemTextCheckBox): """Represent GUI hy2 item TLS insecure.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ItemTLSInsecure.""" super().__init__(*args, **kwargs) @@ -650,6 +663,7 @@ class GuiHy2ItemTLSInsecure(GuiEditorItemTextCheckBox): class GuiHy2GroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI hy2 group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiHy2GroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -671,6 +685,7 @@ class GuiHy2GroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiHy2GroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI hy2 group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiHy2GroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -685,6 +700,7 @@ class GuiHy2GroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiHy2GroupBoxObfs(GuiEditorItemFactory, AppQGroupBox): """Represent GUI hy2 group box obfs.""" + def __init__(self, **kwargs): """Initialize the GuiHy2GroupBoxObfs.""" translatable = kwargs.pop('translatable', False) @@ -779,6 +795,7 @@ class GuiHy2GroupBoxObfs(GuiEditorItemFactory, AppQGroupBox): class GuiHy2GroupBoxTLS(GuiEditorWidgetQGroupBox): """Represent GUI hy2 group box TLS.""" + def __init__(self, **kwargs): """Initialize the GuiHy2GroupBoxTLS.""" super().__init__('TLS', **kwargs) @@ -799,6 +816,7 @@ class GuiHy2GroupBoxTLS(GuiEditorWidgetQGroupBox): class GuiHy2ProjectWebsiteURL(AppQLabel): """Represent GUI hy2 project website URL.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHy2ProjectWebsiteURL.""" super().__init__(*args, **kwargs) @@ -831,6 +849,7 @@ class GuiHy2ProjectWebsiteURL(AppQLabel): class GuiHy2GroupBoxOther(GuiEditorItemFactory, AppQGroupBox): """Represent GUI hy2 group box other.""" + def __init__(self, **kwargs): """Initialize the GuiHy2GroupBoxOther.""" super().__init__(_('Other'), **kwargs) @@ -853,6 +872,7 @@ class GuiHy2GroupBoxOther(GuiEditorItemFactory, AppQGroupBox): class GuiHysteria2(GuiEditorWidgetQDialog): """Represent GUI hysteria2.""" + def __init__(self, *args, **kwargs): """Initialize the GuiHysteria2.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiShadowsocks.py b/Furious/Widget/GuiShadowsocks.py index ad071fa..a8ac85e 100644 --- a/Furious/Widget/GuiShadowsocks.py +++ b/Furious/Widget/GuiShadowsocks.py @@ -40,6 +40,7 @@ getProxyOutboundServer = functools.partial( class GuiSSItemTextInput(GuiEditorItemTextInput): """Represent GUI ss item text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSSItemTextInput.""" key = kwargs.pop('key', '') @@ -85,6 +86,7 @@ class GuiSSItemTextInput(GuiEditorItemTextInput): class GuiSSItemBasicPort(GuiEditorItemTextSpinBox): """Represent GUI ss item basic port.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSSItemBasicPort.""" super().__init__(*args, **kwargs) @@ -125,6 +127,7 @@ class GuiSSItemBasicPort(GuiEditorItemTextSpinBox): class GuiSSItemBasicMethod(GuiEditorItemTextComboBox): """Represent GUI ss item basic method.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSSItemBasicMethod.""" super().__init__(*args, **kwargs) @@ -179,6 +182,7 @@ class GuiSSItemBasicMethod(GuiEditorItemTextComboBox): class GuiSSGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI ss group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiSSGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -196,6 +200,7 @@ class GuiSSGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiSSGroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI ss group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiSSGroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -210,6 +215,7 @@ class GuiSSGroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiShadowsocks(GuiEditorWidgetQDialog): """Represent GUI shadowsocks.""" + def __init__(self, *args, **kwargs): """Initialize the GuiShadowsocks.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiSocks.py b/Furious/Widget/GuiSocks.py index 97a5c58..1cffead 100644 --- a/Furious/Widget/GuiSocks.py +++ b/Furious/Widget/GuiSocks.py @@ -40,6 +40,7 @@ getProxyOutboundServer = functools.partial( class GuiSocksItemTextInput(GuiEditorItemTextInput): """Represent GUI SOCKS item text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSocksItemTextInput.""" key = kwargs.pop('key', '') @@ -84,6 +85,7 @@ class GuiSocksItemTextInput(GuiEditorItemTextInput): class GuiSocksItemBasicPort(GuiEditorItemTextSpinBox): """Represent GUI SOCKS item basic port.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSocksItemBasicPort.""" super().__init__(*args, **kwargs) @@ -123,6 +125,7 @@ class GuiSocksItemBasicPort(GuiEditorItemTextSpinBox): class GuiSocksGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI SOCKS group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiSocksGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -140,6 +143,7 @@ class GuiSocksGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiSocksGroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI SOCKS group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiSocksGroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -154,6 +158,7 @@ class GuiSocksGroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiSocks(GuiEditorWidgetQDialog): """Represent GUI SOCKS.""" + def __init__(self, *args, **kwargs): """Initialize the GuiSocks.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiTUNSettings.py b/Furious/Widget/GuiTUNSettings.py index 1aa04b9..dcc03ab 100644 --- a/Furious/Widget/GuiTUNSettings.py +++ b/Furious/Widget/GuiTUNSettings.py @@ -38,6 +38,7 @@ logger = logging.getLogger(__name__) class GuiTUNSettingsItemXXX(GuiEditorItemTextInput): """Represent GUI TUN settings item xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTUNSettingsItemXXX.""" self.key = kwargs.pop('key', '') @@ -65,6 +66,7 @@ class GuiTUNSettingsItemXXX(GuiEditorItemTextInput): class GuiTUNSettingsItemSpinBoxBufferSizeXXX(GuiEditorItemTextSpinBox): """Represent GUI TUN settings item spin box buffer size xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTUNSettingsItemSpinBoxBufferSizeXXX.""" self.key = kwargs.pop('key', '') @@ -106,6 +108,7 @@ class GuiTUNSettingsItemSpinBoxBufferSizeXXX(GuiEditorItemTextSpinBox): class GuiTUNSettingsItemCheckBoxXXX(GuiEditorItemTextCheckBox): """Represent GUI TUN settings item check box xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTUNSettingsItemCheckBoxXXX.""" self.key = kwargs.pop('key', '') @@ -138,6 +141,7 @@ class GuiTUNSettingsItemCheckBoxXXX(GuiEditorItemTextCheckBox): class AppQLabelHelpPage(AppQLabel): """Represent app q label help page.""" + def __init__(self, *args, **kwargs): """Initialize the AppQLabelHelpPage.""" super().__init__(*args, **kwargs) @@ -170,6 +174,7 @@ class AppQLabelHelpPage(AppQLabel): class GuiTUNSettingsItemHelpPage(GuiEditorItemWidgetContainer): """Provide the TUN settings item help configuration editor page.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTUNSettingsItemHelpPage.""" super().__init__(*args, **kwargs) @@ -183,6 +188,7 @@ class GuiTUNSettingsItemHelpPage(GuiEditorItemWidgetContainer): class GuiTUNSettingsGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI TUN settings group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiTUNSettingsGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -252,6 +258,7 @@ class GuiTUNSettingsGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiTUNSettingsGroupBoxMemory(GuiEditorWidgetQGroupBox): """Represent GUI TUN settings group box memory.""" + def __init__(self, **kwargs): """Initialize the GuiTUNSettingsGroupBoxMemory.""" super().__init__(_('Memory Optimization'), **kwargs) @@ -283,6 +290,7 @@ class GuiTUNSettingsGroupBoxMemory(GuiEditorWidgetQGroupBox): class GuiTUNSettings(GuiEditorWidgetQDialog): """Store and validate GUI TUN settings.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTUNSettings.""" tabTranslatable = kwargs.pop('tabTranslatable', True) diff --git a/Furious/Widget/GuiTrojan.py b/Furious/Widget/GuiTrojan.py index 43345c7..d0b78b0 100644 --- a/Furious/Widget/GuiTrojan.py +++ b/Furious/Widget/GuiTrojan.py @@ -40,6 +40,7 @@ getProxyOutboundServer = functools.partial( class GuiTrojanItemTextInput(GuiEditorItemTextInput): """Represent GUI trojan item text input.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTrojanItemTextInput.""" key = kwargs.pop('key', '') @@ -85,6 +86,7 @@ class GuiTrojanItemTextInput(GuiEditorItemTextInput): class GuiTrojanItemBasicPort(GuiEditorItemTextSpinBox): """Represent GUI trojan item basic port.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTrojanItemBasicPort.""" super().__init__(*args, **kwargs) @@ -125,6 +127,7 @@ class GuiTrojanItemBasicPort(GuiEditorItemTextSpinBox): class GuiTrojanGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI trojan group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiTrojanGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -141,6 +144,7 @@ class GuiTrojanGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiTrojanGroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI trojan group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiTrojanGroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -155,6 +159,7 @@ class GuiTrojanGroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiTrojan(GuiEditorWidgetQDialog): """Represent GUI trojan.""" + def __init__(self, *args, **kwargs): """Initialize the GuiTrojan.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiVLESS.py b/Furious/Widget/GuiVLESS.py index e6ef762..5ac05ff 100644 --- a/Furious/Widget/GuiVLESS.py +++ b/Furious/Widget/GuiVLESS.py @@ -49,6 +49,7 @@ getProxyOutboundUser = functools.partial( class GuiVLESSItemBasicAddress(GuiEditorItemTextInput): """Represent GUI VLESS item basic address.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESSItemBasicAddress.""" super().__init__(*args, **kwargs) @@ -90,6 +91,7 @@ class GuiVLESSItemBasicAddress(GuiEditorItemTextInput): class GuiVLESSItemBasicPort(GuiEditorItemTextSpinBox): """Represent GUI VLESS item basic port.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESSItemBasicPort.""" super().__init__(*args, **kwargs) @@ -130,6 +132,7 @@ class GuiVLESSItemBasicPort(GuiEditorItemTextSpinBox): class GuiVLESSItemBasicId(GuiEditorItemTextInput): """Represent GUI VLESS item basic id.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESSItemBasicId.""" super().__init__(*args, **kwargs) @@ -189,6 +192,7 @@ class GuiVLESSItemBasicId(GuiEditorItemTextInput): class GuiVLESSItemBasicEncryption(GuiEditorItemTextInput): """Represent GUI VLESS item basic encryption.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESSItemBasicEncryption.""" super().__init__(*args, **kwargs) @@ -230,6 +234,7 @@ class GuiVLESSItemBasicEncryption(GuiEditorItemTextInput): class GuiVLESSItemBasicFlow(GuiEditorItemTextComboBox): """Represent GUI VLESS item basic flow.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESSItemBasicFlow.""" super().__init__(*args, **kwargs) @@ -276,6 +281,7 @@ class GuiVLESSItemBasicFlow(GuiEditorItemTextComboBox): class GuiVLESSGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI VLESS group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiVLESSGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -337,6 +343,7 @@ class GuiVLESSGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiVLESSGroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI VLESS group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiVLESSGroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -351,6 +358,7 @@ class GuiVLESSGroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiVLESS(GuiEditorWidgetQDialog): """Represent GUI VLESS.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVLESS.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiVMess.py b/Furious/Widget/GuiVMess.py index 7096c7c..f588224 100644 --- a/Furious/Widget/GuiVMess.py +++ b/Furious/Widget/GuiVMess.py @@ -49,6 +49,7 @@ getProxyOutboundUser = functools.partial( class GuiVMessItemBasicAddress(GuiEditorItemTextInput): """Represent GUI v mess item basic address.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMessItemBasicAddress.""" super().__init__(*args, **kwargs) @@ -90,6 +91,7 @@ class GuiVMessItemBasicAddress(GuiEditorItemTextInput): class GuiVMessItemBasicPort(GuiEditorItemTextSpinBox): """Represent GUI v mess item basic port.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMessItemBasicPort.""" super().__init__(*args, **kwargs) @@ -130,6 +132,7 @@ class GuiVMessItemBasicPort(GuiEditorItemTextSpinBox): class GuiVMessItemBasicId(GuiEditorItemTextInput): """Represent GUI v mess item basic id.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMessItemBasicId.""" super().__init__(*args, **kwargs) @@ -189,6 +192,7 @@ class GuiVMessItemBasicId(GuiEditorItemTextInput): class GuiVMessItemBasicAlterId(GuiEditorItemTextSpinBox): """Represent GUI v mess item basic alter id.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMessItemBasicAlterId.""" super().__init__(*args, **kwargs) @@ -229,6 +233,7 @@ class GuiVMessItemBasicAlterId(GuiEditorItemTextSpinBox): class GuiVMessItemBasicSecurity(GuiEditorItemTextComboBox): """Represent GUI v mess item basic security.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMessItemBasicSecurity.""" super().__init__(*args, **kwargs) @@ -277,6 +282,7 @@ class GuiVMessItemBasicSecurity(GuiEditorItemTextComboBox): class GuiVMessGroupBoxBasic(GuiEditorWidgetQGroupBox): """Represent GUI v mess group box basic.""" + def __init__(self, **kwargs): """Initialize the GuiVMessGroupBoxBasic.""" super().__init__(_('Basic Configuration'), **kwargs) @@ -346,6 +352,7 @@ class GuiVMessGroupBoxBasic(GuiEditorWidgetQGroupBox): class GuiVMessGroupBoxProxy(GuiEditorWidgetQGroupBox): """Represent GUI v mess group box proxy.""" + def __init__(self, **kwargs): """Initialize the GuiVMessGroupBoxProxy.""" super().__init__(_('Proxy'), **kwargs) @@ -360,6 +367,7 @@ class GuiVMessGroupBoxProxy(GuiEditorWidgetQGroupBox): class GuiVMess(GuiEditorWidgetQDialog): """Represent GUI v mess.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVMess.""" super().__init__(*args, **kwargs) diff --git a/Furious/Widget/GuiVTLS.py b/Furious/Widget/GuiVTLS.py index 791d448..088de8d 100644 --- a/Furious/Widget/GuiVTLS.py +++ b/Furious/Widget/GuiVTLS.py @@ -40,6 +40,7 @@ STREAM_SECURITY = [ class GuiVTLSItemSecurity(GuiEditorItemTextComboBox): """Represent GUI vtls item security.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemSecurity.""" super().__init__(*args, **kwargs) @@ -101,6 +102,7 @@ class GuiVTLSItemSecurity(GuiEditorItemTextComboBox): class GuiVTLSItemXXXServerName(GuiEditorItemTextInput): """Represent GUI vtls item xxx server name.""" + def __init__(self, *args, **kwargs): # Mandatory """Initialize the GuiVTLSItemXXXServerName.""" @@ -161,6 +163,7 @@ class GuiVTLSItemXXXServerName(GuiEditorItemTextInput): class GuiVTLSItemTLSServerName(GuiVTLSItemXXXServerName): """Represent GUI vtls item TLS server name.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemTLSServerName.""" securityKey = kwargs.pop('securityKey', 'tlsSettings') @@ -170,6 +173,7 @@ class GuiVTLSItemTLSServerName(GuiVTLSItemXXXServerName): class GuiVTLSItemRealityServerName(GuiVTLSItemXXXServerName): """Represent GUI vtls item reality server name.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealityServerName.""" securityKey = kwargs.pop('securityKey', 'realitySettings') @@ -179,6 +183,7 @@ class GuiVTLSItemRealityServerName(GuiVTLSItemXXXServerName): class GuiVTLSItemXXXFingerprint(GuiEditorItemTextInput): """Represent GUI vtls item xxx fingerprint.""" + def __init__(self, *args, **kwargs): # Mandatory """Initialize the GuiVTLSItemXXXFingerprint.""" @@ -239,6 +244,7 @@ class GuiVTLSItemXXXFingerprint(GuiEditorItemTextInput): class GuiVTLSItemTLSFingerprint(GuiVTLSItemXXXFingerprint): """Represent GUI vtls item TLS fingerprint.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemTLSFingerprint.""" securityKey = kwargs.pop('securityKey', 'tlsSettings') @@ -248,6 +254,7 @@ class GuiVTLSItemTLSFingerprint(GuiVTLSItemXXXFingerprint): class GuiVTLSItemRealityFingerprint(GuiVTLSItemXXXFingerprint): """Represent GUI vtls item reality fingerprint.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealityFingerprint.""" securityKey = kwargs.pop('securityKey', 'realitySettings') @@ -257,6 +264,7 @@ class GuiVTLSItemRealityFingerprint(GuiVTLSItemXXXFingerprint): class GuiVTLSItemTLSAlpn(GuiEditorItemTextInput): """Represent GUI vtls item TLS alpn.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemTLSAlpn.""" super().__init__(*args, **kwargs) @@ -312,6 +320,7 @@ class GuiVTLSItemTLSAlpn(GuiEditorItemTextInput): class GuiVTLSItemTLSXXXTextInput(GuiEditorItemTextInput): """Represent GUI vtls item tlsxxx text input.""" + def __init__(self, *args, **kwargs): # Mandatory """Initialize the GuiVTLSItemTLSXXXTextInput.""" @@ -366,6 +375,7 @@ class GuiVTLSItemTLSXXXTextInput(GuiEditorItemTextInput): class GuiVTLSItemTLSAllowInsecure(GuiEditorItemTextCheckBox): """Represent GUI vtls item TLS allow insecure.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemTLSAllowInsecure.""" super().__init__(*args, **kwargs) @@ -417,6 +427,7 @@ class GuiVTLSItemTLSAllowInsecure(GuiEditorItemTextCheckBox): class GuiVTLSItemRealityXXX(GuiEditorItemTextInput): """Represent GUI vtls item reality xxx.""" + def __init__(self, *args, **kwargs): # Mandatory """Initialize the GuiVTLSItemRealityXXX.""" @@ -477,6 +488,7 @@ class GuiVTLSItemRealityXXX(GuiEditorItemTextInput): class GuiVTLSItemRealityPublicKey(GuiVTLSItemRealityXXX): """Represent GUI vtls item reality public key.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealityPublicKey.""" realityKey = kwargs.pop('realityKey', 'publicKey') @@ -486,6 +498,7 @@ class GuiVTLSItemRealityPublicKey(GuiVTLSItemRealityXXX): class GuiVTLSItemRealityShortId(GuiVTLSItemRealityXXX): """Represent GUI vtls item reality short id.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealityShortId.""" realityKey = kwargs.pop('realityKey', 'shortId') @@ -495,6 +508,7 @@ class GuiVTLSItemRealityShortId(GuiVTLSItemRealityXXX): class GuiVTLSItemRealityMldsa65Verify(GuiVTLSItemRealityXXX): """Represent GUI vtls item reality mldsa65 verify.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealityMldsa65Verify.""" realityKey = kwargs.pop('realityKey', 'mldsa65Verify') @@ -504,6 +518,7 @@ class GuiVTLSItemRealityMldsa65Verify(GuiVTLSItemRealityXXX): class GuiVTLSItemRealitySpiderX(GuiVTLSItemRealityXXX): """Represent GUI vtls item reality spider x.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSItemRealitySpiderX.""" realityKey = kwargs.pop('realityKey', 'spiderX') @@ -513,6 +528,7 @@ class GuiVTLSItemRealitySpiderX(GuiVTLSItemRealityXXX): class GuiVTLSPageXXX(GuiEditorWidgetQWidget): """Represent GUI vtls page xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageXXX.""" super().__init__(*args, **kwargs) @@ -534,6 +550,7 @@ class GuiVTLSPageXXX(GuiEditorWidgetQWidget): class GuiVTLSPageEmpty(GuiVTLSPageXXX): """Represent GUI vtls page empty.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageEmpty.""" super().__init__(*args, **kwargs) @@ -547,6 +564,7 @@ class GuiVTLSPageEmpty(GuiVTLSPageXXX): class GuiVTLSPageNone(GuiVTLSPageXXX): """Represent GUI vtls page none.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageNone.""" super().__init__(*args, **kwargs) @@ -560,6 +578,7 @@ class GuiVTLSPageNone(GuiVTLSPageXXX): class GuiVTLSPageTLS(GuiVTLSPageXXX): """Represent GUI vtls page TLS.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageTLS.""" super().__init__(*args, **kwargs) @@ -641,6 +660,7 @@ class GuiVTLSPageTLS(GuiVTLSPageXXX): class GuiVTLSPageReality(GuiVTLSPageXXX): """Represent GUI vtls page reality.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageReality.""" super().__init__(*args, **kwargs) @@ -691,6 +711,7 @@ class GuiVTLSPageReality(GuiVTLSPageXXX): class GuiVTLSPageStackedWidget(QStackedWidget): """Provide the GUI vtls page stacked widget.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTLSPageStackedWidget.""" super().__init__(*args, **kwargs) @@ -718,6 +739,7 @@ class GuiVTLSPageStackedWidget(QStackedWidget): class GuiVTLSQGroupBox(GuiEditorItemFactory, AppQGroupBox): """Group the GUI vtlsq editor controls.""" + def __init__(self, **kwargs): """Initialize the GuiVTLSQGroupBox.""" translatable = kwargs.pop('translatable', False) diff --git a/Furious/Widget/GuiVTransport.py b/Furious/Widget/GuiVTransport.py index 9fd5335..29e69b2 100644 --- a/Furious/Widget/GuiVTransport.py +++ b/Furious/Widget/GuiVTransport.py @@ -47,6 +47,7 @@ STREAM_NETWORK = [ class GuiVTransportItemNetwork(GuiEditorItemTextComboBox): """Represent GUI v transport item network.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemNetwork.""" super().__init__(*args, **kwargs) @@ -108,6 +109,7 @@ class GuiVTransportItemNetwork(GuiEditorItemTextComboBox): class GuiVTransportItemFinalMask(GuiEditorItemTextInput): """Represent GUI v transport item final mask.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemFinalMask.""" super().__init__(*args, **kwargs) @@ -160,6 +162,7 @@ class GuiVTransportItemFinalMask(GuiEditorItemTextInput): class GuiVTransportItemTypeXXX(GuiEditorItemTextComboBox): """Represent GUI v transport item type xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemTypeXXX.""" networkKey = kwargs.pop('networkKey', '') @@ -222,6 +225,7 @@ class GuiVTransportItemTypeXXX(GuiEditorItemTextComboBox): class GuiVTransportItemTypeTcpOrRaw(GuiVTransportItemTypeXXX): """Represent GUI v transport item type TCP or raw.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemTypeTcpOrRaw.""" networkKey = kwargs.pop('networkKey', 'tcpSettings') @@ -239,6 +243,7 @@ class GuiVTransportItemTypeTcpOrRaw(GuiVTransportItemTypeXXX): class GuiVTransportItemHostTcpOrRaw(GuiEditorItemTextInput): """Represent GUI v transport item host TCP or raw.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostTcpOrRaw.""" networkKey = kwargs.pop('networkKey', 'tcpSettings') @@ -307,6 +312,7 @@ class GuiVTransportItemHostTcpOrRaw(GuiEditorItemTextInput): class GuiVTransportItemPathTcpOrRaw(GuiEditorItemTextInput): """Represent GUI v transport item path TCP or raw.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathTcpOrRaw.""" networkKey = kwargs.pop('networkKey', 'tcpSettings') @@ -372,6 +378,7 @@ class GuiVTransportItemPathTcpOrRaw(GuiEditorItemTextInput): class GuiVTransportItemTypeKcp(GuiVTransportItemTypeXXX): """Represent GUI v transport item type kcp.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemTypeKcp.""" networkKey = kwargs.pop('networkKey', 'kcpSettings') @@ -394,6 +401,7 @@ class GuiVTransportItemTypeKcp(GuiVTransportItemTypeXXX): class GuiVTransportItemSeedKcp(GuiEditorItemTextInput): """Represent GUI v transport item seed kcp.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemSeedKcp.""" super().__init__(*args, **kwargs) @@ -449,6 +457,7 @@ class GuiVTransportItemSeedKcp(GuiEditorItemTextInput): class GuiVTransportItemHostWs(GuiEditorItemTextInput): """Represent GUI v transport item host ws.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostWs.""" super().__init__(*args, **kwargs) @@ -507,6 +516,7 @@ class GuiVTransportItemHostWs(GuiEditorItemTextInput): class GuiVTransportItemPathWs(GuiEditorItemTextInput): """Represent GUI v transport item path ws.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathWs.""" super().__init__(*args, **kwargs) @@ -562,6 +572,7 @@ class GuiVTransportItemPathWs(GuiEditorItemTextInput): class GuiVTransportItemHostHttpUpgrade(GuiEditorItemTextInput): """Represent GUI v transport item host HTTP upgrade.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostHttpUpgrade.""" super().__init__(*args, **kwargs) @@ -619,6 +630,7 @@ class GuiVTransportItemHostHttpUpgrade(GuiEditorItemTextInput): class GuiVTransportItemPathHttpUpgrade(GuiEditorItemTextInput): """Represent GUI v transport item path HTTP upgrade.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathHttpUpgrade.""" super().__init__(*args, **kwargs) @@ -676,6 +688,7 @@ class GuiVTransportItemPathHttpUpgrade(GuiEditorItemTextInput): class GuiVTransportItemHostSplitHttp(GuiEditorItemTextInput): """Represent GUI v transport item host split HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostSplitHttp.""" super().__init__(*args, **kwargs) @@ -733,6 +746,7 @@ class GuiVTransportItemHostSplitHttp(GuiEditorItemTextInput): class GuiVTransportItemPathSplitHttp(GuiEditorItemTextInput): """Represent GUI v transport item path split HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathSplitHttp.""" super().__init__(*args, **kwargs) @@ -790,6 +804,7 @@ class GuiVTransportItemPathSplitHttp(GuiEditorItemTextInput): class GuiVTransportItemHostXHttp(GuiEditorItemTextInput): """Represent GUI v transport item host x HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostXHttp.""" super().__init__(*args, **kwargs) @@ -845,6 +860,7 @@ class GuiVTransportItemHostXHttp(GuiEditorItemTextInput): class GuiVTransportItemPathXHttp(GuiEditorItemTextInput): """Represent GUI v transport item path x HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathXHttp.""" super().__init__(*args, **kwargs) @@ -900,6 +916,7 @@ class GuiVTransportItemPathXHttp(GuiEditorItemTextInput): class GuiVTransportItemModeXHttp(GuiEditorItemTextComboBox): """Represent GUI v transport item mode x HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemModeXHttp.""" super().__init__(*args, **kwargs) @@ -964,6 +981,7 @@ class GuiVTransportItemModeXHttp(GuiEditorItemTextComboBox): class GuiVTransportItemExtraXHttp(GuiEditorItemTextInput): """Represent GUI v transport item extra x HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemExtraXHttp.""" super().__init__(*args, **kwargs) @@ -1030,6 +1048,7 @@ class GuiVTransportItemExtraXHttp(GuiEditorItemTextInput): class GuiVTransportItemHostH2(GuiEditorItemTextInput): """Represent GUI v transport item host h2.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemHostH2.""" super().__init__(*args, **kwargs) @@ -1085,6 +1104,7 @@ class GuiVTransportItemHostH2(GuiEditorItemTextInput): class GuiVTransportItemPathH2(GuiEditorItemTextInput): """Represent GUI v transport item path h2.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPathH2.""" super().__init__(*args, **kwargs) @@ -1140,6 +1160,7 @@ class GuiVTransportItemPathH2(GuiEditorItemTextInput): class GuiVTransportItemTypeQuic(GuiVTransportItemTypeXXX): """Represent GUI v transport item type quic.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemTypeQuic.""" networkKey = kwargs.pop('networkKey', 'quicSettings') @@ -1161,6 +1182,7 @@ class GuiVTransportItemTypeQuic(GuiVTransportItemTypeXXX): class GuiVTransportItemSecurityQuic(GuiEditorItemTextComboBox): """Represent GUI v transport item security quic.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemSecurityQuic.""" super().__init__(*args, **kwargs) @@ -1222,6 +1244,7 @@ class GuiVTransportItemSecurityQuic(GuiEditorItemTextComboBox): class GuiVTransportItemKeyQuic(GuiEditorItemTextInput): """Represent GUI v transport item key quic.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemKeyQuic.""" super().__init__(*args, **kwargs) @@ -1277,6 +1300,7 @@ class GuiVTransportItemKeyQuic(GuiEditorItemTextInput): class GuiVTransportItemModeGRPC(GuiEditorItemTextComboBox): """Represent GUI v transport item mode grpc.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemModeGRPC.""" super().__init__(*args, **kwargs) @@ -1352,6 +1376,7 @@ class GuiVTransportItemModeGRPC(GuiEditorItemTextComboBox): class GuiVTransportItemAuthorityGRPC(GuiEditorItemTextInput): """Represent GUI v transport item authority grpc.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemAuthorityGRPC.""" super().__init__(*args, **kwargs) @@ -1407,6 +1432,7 @@ class GuiVTransportItemAuthorityGRPC(GuiEditorItemTextInput): class GuiVTransportItemServiceNameGRPC(GuiEditorItemTextInput): """Represent GUI v transport item service name grpc.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemServiceNameGRPC.""" super().__init__(*args, **kwargs) @@ -1462,6 +1488,7 @@ class GuiVTransportItemServiceNameGRPC(GuiEditorItemTextInput): class GuiVTransportItemVersionHysteria(GuiEditorItemTextSpinBox): """Represent GUI v transport item version hysteria.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemVersionHysteria.""" super().__init__(*args, **kwargs) @@ -1509,6 +1536,7 @@ class GuiVTransportItemVersionHysteria(GuiEditorItemTextSpinBox): class GuiVTransportItemAuthHysteria(GuiEditorItemTextInput): """Represent GUI v transport item auth hysteria.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemAuthHysteria.""" super().__init__(*args, **kwargs) @@ -1566,6 +1594,7 @@ class GuiVTransportItemAuthHysteria(GuiEditorItemTextInput): class GuiVTransportItemPasswordHysteria(GuiEditorItemTextInput): """Represent GUI v transport item password hysteria.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportItemPasswordHysteria.""" super().__init__(*args, **kwargs) @@ -1628,6 +1657,7 @@ class GuiVTransportItemPasswordHysteria(GuiEditorItemTextInput): class GuiVTransportPageXXX(GuiEditorWidgetQWidget): """Represent GUI v transport page xxx.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageXXX.""" super().__init__(*args, **kwargs) @@ -1649,6 +1679,7 @@ class GuiVTransportPageXXX(GuiEditorWidgetQWidget): class GuiVTransportPageTcp(GuiVTransportPageXXX): """Represent GUI v transport page TCP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageTcp.""" super().__init__(*args, **kwargs) @@ -1672,6 +1703,7 @@ class GuiVTransportPageTcp(GuiVTransportPageXXX): class GuiVTransportPageRaw(GuiVTransportPageXXX): """Represent GUI v transport page raw.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageRaw.""" super().__init__(*args, **kwargs) @@ -1695,6 +1727,7 @@ class GuiVTransportPageRaw(GuiVTransportPageXXX): class GuiVTransportPageKcp(GuiVTransportPageXXX): """Represent GUI v transport page kcp.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageKcp.""" super().__init__(*args, **kwargs) @@ -1711,6 +1744,7 @@ class GuiVTransportPageKcp(GuiVTransportPageXXX): class GuiVTransportPageWs(GuiVTransportPageXXX): """Represent GUI v transport page ws.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageWs.""" super().__init__(*args, **kwargs) @@ -1727,6 +1761,7 @@ class GuiVTransportPageWs(GuiVTransportPageXXX): class GuiVTransportPageHttpUpgrade(GuiVTransportPageXXX): """Represent GUI v transport page HTTP upgrade.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageHttpUpgrade.""" super().__init__(*args, **kwargs) @@ -1743,6 +1778,7 @@ class GuiVTransportPageHttpUpgrade(GuiVTransportPageXXX): class GuiVTransportPageSplitHttp(GuiVTransportPageXXX): """Represent GUI v transport page split HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageSplitHttp.""" super().__init__(*args, **kwargs) @@ -1759,6 +1795,7 @@ class GuiVTransportPageSplitHttp(GuiVTransportPageXXX): class GuiVTransportPageXHttp(GuiVTransportPageXXX): """Represent GUI v transport page x HTTP.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageXHttp.""" super().__init__(*args, **kwargs) @@ -1777,6 +1814,7 @@ class GuiVTransportPageXHttp(GuiVTransportPageXXX): class GuiVTransportPageH2(GuiVTransportPageXXX): """Represent GUI v transport page h2.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageH2.""" super().__init__(*args, **kwargs) @@ -1793,6 +1831,7 @@ class GuiVTransportPageH2(GuiVTransportPageXXX): class GuiVTransportPageQuic(GuiVTransportPageXXX): """Represent GUI v transport page quic.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageQuic.""" super().__init__(*args, **kwargs) @@ -1810,6 +1849,7 @@ class GuiVTransportPageQuic(GuiVTransportPageXXX): class GuiVTransportPageGRPC(GuiVTransportPageXXX): """Represent GUI v transport page grpc.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageGRPC.""" super().__init__(*args, **kwargs) @@ -1829,6 +1869,7 @@ class GuiVTransportPageGRPC(GuiVTransportPageXXX): class GuiVTransportPageHysteria(GuiVTransportPageXXX): """Represent GUI v transport page hysteria.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageHysteria.""" super().__init__(*args, **kwargs) @@ -1846,6 +1887,7 @@ class GuiVTransportPageHysteria(GuiVTransportPageXXX): class GuiVTransportPageStackedWidget(QStackedWidget): """Provide the GUI v transport page stacked widget.""" + def __init__(self, *args, **kwargs): """Initialize the GuiVTransportPageStackedWidget.""" super().__init__(*args, **kwargs) @@ -1882,6 +1924,7 @@ class GuiVTransportPageStackedWidget(QStackedWidget): class GuiVTransportQGroupBox(GuiEditorItemFactory, AppQGroupBox): """Group the GUI v transport q editor controls.""" + def __init__(self, **kwargs): """Initialize the GuiVTransportQGroupBox.""" super().__init__(_('Transport'), **kwargs) diff --git a/Furious/Widget/IndentSpinBox.py b/Furious/Widget/IndentSpinBox.py index 45e9053..1291c4a 100644 --- a/Furious/Widget/IndentSpinBox.py +++ b/Furious/Widget/IndentSpinBox.py @@ -30,6 +30,7 @@ __all__ = ['IndentSpinBox'] class IndentSpinBox(AppQDialog): """Represent indent spin box.""" + def __init__(self, parent=None): """Initialize the IndentSpinBox.""" super().__init__(parent) diff --git a/Furious/Widget/SystemTrayIcon.py b/Furious/Widget/SystemTrayIcon.py index 0bf4ca2..8368e38 100644 --- a/Furious/Widget/SystemTrayIcon.py +++ b/Furious/Widget/SystemTrayIcon.py @@ -48,6 +48,7 @@ class SystemTrayIcon( QSystemTrayIcon, ): """Represent system tray icon.""" + def __init__(self, *args, **kwargs): """Initialize the SystemTrayIcon.""" super().__init__(*args, **kwargs) @@ -146,6 +147,7 @@ class SystemTrayIcon( def setMonochromeIconByTheme(self, theme): """Set monochrome icon by theme.""" + def switchMonochrome(): """Handle switch monochrome for the system tray icon.""" if theme == 'Dark': diff --git a/Furious/Widget/UserServersQTableView.py b/Furious/Widget/UserServersQTableView.py index 54a56aa..3f2e113 100644 --- a/Furious/Widget/UserServersQTableView.py +++ b/Furious/Widget/UserServersQTableView.py @@ -77,6 +77,7 @@ def appIsExiting() -> bool: class MBoxUpdateSubsInfo(AppQMessageBox): """Represent m box update subs info.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxUpdateSubsInfo.""" self.successArgs = kwargs.pop('successArgs', list()) @@ -147,6 +148,7 @@ class MBoxUpdateSubsInfo(AppQMessageBox): class SubscriptionManager(WebGETManager): """Coordinate subscription operations.""" + def __init__(self, parent, **kwargs): """Initialize the SubscriptionManager.""" actionMessage = kwargs.pop('actionMessage', 'update subs') @@ -353,6 +355,7 @@ class SubscriptionManager(WebGETManager): class TestPingLatencyWorker(QtCore.QObject, QtCore.QRunnable): """Run test ping latency work in the background.""" + finished = QtCore.Signal() def __init__(self, factory: ConfigFactory): @@ -401,6 +404,7 @@ class TestPingLatencyWorker(QtCore.QObject, QtCore.QRunnable): class TestTcpingLatencyWorker(QtCore.QObject, QtCore.QRunnable): """Run test tcping latency work in the background.""" + finished = QtCore.Signal() def __init__(self, factory: ConfigFactory): @@ -446,6 +450,7 @@ class TestTcpingLatencyWorker(QtCore.QObject, QtCore.QRunnable): class TestDownloadSpeedWorker(WebGETManager): """Run test download speed work in the background.""" + progressed = QtCore.Signal() finished = QtCore.Signal(object) @@ -739,6 +744,7 @@ class TestDownloadSpeedWorker(WebGETManager): class DownloadSpeedTestJob: """Represent download speed test job.""" + def __init__( self, index: int, @@ -757,6 +763,7 @@ class DownloadSpeedTestJob: class DownloadSpeedTestScheduler(QtCore.QObject): """Schedule and coordinate download speed test jobs.""" + SinglePort = 20809 MultiPortStart = 30000 MultiPortStop = 40000 @@ -908,6 +915,7 @@ class DownloadSpeedTestScheduler(QtCore.QObject): class DeleteServersProgressDialog(AppQDialog): """Present progress and cancellation controls for delete servers.""" + def __init__(self, table, indexes, showTrayMessage=True, parent=None): """Initialize the DeleteServersProgressDialog.""" super().__init__(parent) @@ -1082,6 +1090,7 @@ class DeleteServersProgressDialog(AppQDialog): class UserServersQTableViewHorizontalHeader(AppQHeaderView): """Provide the user servers Qt table view horizontal table header.""" + def __init__(self, *args, **kwargs): """Initialize the UserServersQTableViewHorizontalHeader.""" super().__init__(QtCore.Qt.Orientation.Horizontal, *args, **kwargs) @@ -1089,6 +1098,7 @@ class UserServersQTableViewHorizontalHeader(AppQHeaderView): class UserServersQTableViewVerticalHeader(AppQHeaderView): """Provide the user servers Qt table view vertical table header.""" + def __init__(self, *args, **kwargs): """Initialize the UserServersQTableViewVerticalHeader.""" super().__init__(QtCore.Qt.Orientation.Vertical, *args, **kwargs) @@ -1096,6 +1106,7 @@ class UserServersQTableViewVerticalHeader(AppQHeaderView): class UserServersQTableViewHeaders: """Describe and render user servers Qt table view table columns.""" + def __init__(self, name: str, func: Callable[[ConfigFactory], str] = None): """Initialize the UserServersQTableViewHeaders.""" self.name = name @@ -1119,6 +1130,7 @@ class UserServersQTableViewHeaders: class UserServersTableModel(QtCore.QAbstractTableModel): """Expose user servers table data through a Qt item model.""" + SortRole = QtCore.Qt.ItemDataRole.UserRole + 1 def __init__(self, headers: list[UserServersQTableViewHeaders], parent=None): @@ -1318,6 +1330,7 @@ class UserServersTableModel(QtCore.QAbstractTableModel): class UserServersSortFilterProxyModel(QtCore.QSortFilterProxyModel): """Filter and sort user servers sort filter data.""" + def __init__(self, parent=None): """Initialize the UserServersSortFilterProxyModel.""" super().__init__(parent) @@ -1443,6 +1456,7 @@ class UserServersQTableView( AppQTableView, ): """Represent user servers Qt table view.""" + RowHeight = 42 Headers = [ @@ -2140,6 +2154,7 @@ class UserServersQTableView( def swapItem(self, index0: int, index1: int): """Handle swap item for the user servers Qt table view.""" + def swapSequenceItem(sequence: MutableSequence, param0: int, param1: int): """Handle swap sequence item for the user servers Qt table view.""" swap = sequence[param0] diff --git a/Furious/Widget/UserSubsQTableView.py b/Furious/Widget/UserSubsQTableView.py index 14e2cc8..218e01c 100644 --- a/Furious/Widget/UserSubsQTableView.py +++ b/Furious/Widget/UserSubsQTableView.py @@ -44,6 +44,7 @@ registerAppSettings('UserSubsHeaderViewState') class UserSubsQTableViewHorizontalHeader(AppQHeaderView): """Provide the user subs Qt table view horizontal table header.""" + def __init__(self, *args, **kwargs): """Initialize the UserSubsQTableViewHorizontalHeader.""" super().__init__(QtCore.Qt.Orientation.Horizontal, *args, **kwargs) @@ -51,6 +52,7 @@ class UserSubsQTableViewHorizontalHeader(AppQHeaderView): class UserSubsQTableViewVerticalHeader(AppQHeaderView): """Provide the user subs Qt table view vertical table header.""" + def __init__(self, *args, **kwargs): """Initialize the UserSubsQTableViewVerticalHeader.""" super().__init__(QtCore.Qt.Orientation.Vertical, *args, **kwargs) @@ -58,6 +60,7 @@ class UserSubsQTableViewVerticalHeader(AppQHeaderView): class UserSubsQTableViewHeaders: """Describe and render user subs Qt table view table columns.""" + def __init__(self, name: str, func: Callable[[dict], str] = None): """Initialize the UserSubsQTableViewHeaders.""" self.name = name @@ -81,6 +84,7 @@ class UserSubsQTableViewHeaders: class UserSubsAppQComboBox(AppQComboBox): """Represent user subs app q combo box.""" + def __init__(self, *args, **kwargs): """Initialize the UserSubsAppQComboBox.""" super().__init__(*args, **kwargs) @@ -94,6 +98,7 @@ class UserSubsAppQComboBox(AppQComboBox): class UserSubsTableModel(QtCore.QAbstractTableModel): """Expose user subs table data through a Qt item model.""" + def __init__( self, headers: list[UserSubsQTableViewHeaders], @@ -268,6 +273,7 @@ _TRANSLATABLE_HEADERS = [ class UserSubsQTableView(Mixins.QTranslatable, AppQTableView): """Represent user subs Qt table view.""" + RowHeight = 42 AutoUpdateOptions = { diff --git a/Furious/Widget/XrayAssetViewerQListWidget.py b/Furious/Widget/XrayAssetViewerQListWidget.py index 06def65..aeee701 100644 --- a/Furious/Widget/XrayAssetViewerQListWidget.py +++ b/Furious/Widget/XrayAssetViewerQListWidget.py @@ -40,6 +40,7 @@ logger = logging.getLogger(__name__) class MBoxAssetExists(AppQMessageBox): """Represent m box asset exists.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxAssetExists.""" super().__init__(*args, **kwargs) @@ -60,6 +61,7 @@ class MBoxAssetExists(AppQMessageBox): class XrayAssetViewerQListWidget(Mixins.ThemeAware, AppQListWidget): """Provide the Xray asset viewer Qt list widget.""" + def __init__(self, *args, **kwargs): """Initialize the XrayAssetViewerQListWidget.""" super().__init__(*args, **kwargs) @@ -161,6 +163,7 @@ class XrayAssetViewerQListWidget(Mixins.ThemeAware, AppQListWidget): def appendNewItem(self, filename: str): """Append new item.""" + def append(_filename): """Append the Xray asset viewer Qt list widget.""" try: diff --git a/Furious/Window/AppMainWindow.py b/Furious/Window/AppMainWindow.py index 0f45316..0956a70 100644 --- a/Furious/Window/AppMainWindow.py +++ b/Furious/Window/AppMainWindow.py @@ -54,6 +54,7 @@ registerAppSettings('AppMainWindowState') class AppNetworkConnectivityManager(NetworkConnectivityManager): """Coordinate app network connectivity operations.""" + def __init__(self, parent=None): """Initialize the AppNetworkConnectivityManager.""" super().__init__(parent) @@ -110,6 +111,7 @@ class AppNetworkConnectivityManager(NetworkConnectivityManager): class NetworkStateBadge(Mixins.QTranslatable, Mixins.ThemeAware, QWidget): """Provide the network state badge widget.""" + DefaultIconFileName = 'reception-4.svg' StateIconFileName = { 'success': 'reception-4.svg', @@ -229,6 +231,7 @@ class NetworkStateBadge(Mixins.QTranslatable, Mixins.ThemeAware, QWidget): class SearchButton(AppQPushButton): """Represent search button.""" + def __init__(self, *args, **kwargs): """Initialize the SearchButton.""" super().__init__(*args, **kwargs) @@ -248,6 +251,7 @@ class SearchButton(AppQPushButton): class AppMainWindow(AppQMainWindow): """Present the app main window.""" + DEFAULT_WINDOW_SIZE_DARWIN = QtCore.QSize(1500, 780) DEFAULT_WINDOW_SIZE = ( QtCore.QSize(1800, 960) if PLATFORM != 'Darwin' else DEFAULT_WINDOW_SIZE_DARWIN @@ -661,6 +665,7 @@ class AppMainWindow(AppQMainWindow): def getGuiTUNSettings(self, **kwargs): """Return GUI TUN settings.""" + @functools.lru_cache(None) def cachedGuiTUNSettings(): """Return the cached GUI TUN settings value used by the app main window.""" diff --git a/Furious/Window/LogViewerWindow.py b/Furious/Window/LogViewerWindow.py index 3bb9434..937648e 100644 --- a/Furious/Window/LogViewerWindow.py +++ b/Furious/Window/LogViewerWindow.py @@ -30,6 +30,7 @@ __all__ = ['LogViewerWindow'] class MBoxSaveError(AppQMessageBox): """Represent m box save error.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxSaveError.""" super().__init__(*args, **kwargs) @@ -77,6 +78,7 @@ def saveAsFile(content: str): class LogViewerWindow(AppQMainWindow): """Present the log viewer window.""" + def __init__(self, *args, **kwargs): """Initialize the LogViewerWindow.""" tabTitle = kwargs.pop('tabTitle', '') diff --git a/Furious/Window/QRCodeWindow.py b/Furious/Window/QRCodeWindow.py index 64e56b4..72ae898 100644 --- a/Furious/Window/QRCodeWindow.py +++ b/Furious/Window/QRCodeWindow.py @@ -36,6 +36,7 @@ __all__ = ['QRCodeWindow'] class QRCodeWindow(AppQMainWindow): """Present the QR code window.""" + def __init__(self, *args, **kwargs): """Initialize the QRCodeWindow.""" super().__init__(*args, **kwargs) diff --git a/Furious/Window/TextEditorWindow.py b/Furious/Window/TextEditorWindow.py index 3ddbe30..19e7dcc 100644 --- a/Furious/Window/TextEditorWindow.py +++ b/Furious/Window/TextEditorWindow.py @@ -38,6 +38,7 @@ registerAppSettings('ServerWidgetPointSize') class MBoxQuestionSave(AppQMessageBox): """Represent m box question save.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxQuestionSave.""" super().__init__(*args, **kwargs) @@ -56,6 +57,7 @@ class MBoxQuestionSave(AppQMessageBox): class MBoxJSONDecodeError(AppQMessageBox): """Represent m box JSON decode error.""" + def __init__(self, *args, **kwargs): """Initialize the MBoxJSONDecodeError.""" super().__init__(*args, **kwargs) @@ -81,6 +83,7 @@ class MBoxJSONDecodeError(AppQMessageBox): class TextEditorWindow(AppQMainWindow): """Present the text editor window.""" + def __init__(self, *args, **kwargs): """Initialize the TextEditorWindow.""" super().__init__(*args, **kwargs) @@ -335,6 +338,7 @@ class TextEditorWindow(AppQMainWindow): def setIndent(self): """Set indent.""" + def handleResultCode(_indentSpinBox, code): """Handle result code.""" if code == PySide6Legacy.enumValueWrapper(AppQDialog.DialogCode.Accepted): diff --git a/Furious/Window/UserRoutingWindow.py b/Furious/Window/UserRoutingWindow.py index 6b87298..07812e5 100644 --- a/Furious/Window/UserRoutingWindow.py +++ b/Furious/Window/UserRoutingWindow.py @@ -125,6 +125,7 @@ def routingObjectFromProfile(routingProfile: dict): class RoutingPreviewDialog(AppQDialog): """Present the routing preview dialog.""" + def __init__(self, routingProfile: dict, parent=None): """Initialize the RoutingPreviewDialog.""" super().__init__(parent) @@ -167,6 +168,7 @@ class RoutingPreviewDialog(AppQDialog): class RoutingTextEditDialog(AppQDialog): """Present the routing text edit dialog.""" + def __init__(self, text='', parent=None): """Initialize the RoutingTextEditDialog.""" super().__init__(parent) @@ -202,6 +204,7 @@ class RoutingTextEditDialog(AppQDialog): class RoutingTextEdit(Mixins.QTranslatable, QTextEdit): """Represent routing text edit.""" + def __init__(self, text='', parent=None): """Initialize the RoutingTextEdit.""" super().__init__(text, parent) @@ -229,6 +232,7 @@ class RoutingTextEdit(Mixins.QTranslatable, QTextEdit): class RoutingDocumentationURL(AppQLabel): """Represent routing documentation URL.""" + URL = 'https://xtls.github.io/config/routing.html' def __init__(self, *args, **kwargs): @@ -263,6 +267,7 @@ class RoutingDocumentationURL(AppQLabel): class RoutingProfilesModel(QtCore.QAbstractTableModel): """Expose routing profiles data through a Qt item model.""" + Headers = ['Remark', 'Domain Strategy', 'State'] def rowCount(self, parent=QtCore.QModelIndex()) -> int: @@ -353,6 +358,7 @@ class RoutingProfilesModel(QtCore.QAbstractTableModel): class RoutingRuleEditDialog(AppQDialog): """Present the routing rule edit dialog.""" + MatchInputHeight = 72 ShortInputWidth = 240 @@ -581,6 +587,7 @@ class RoutingRuleEditDialog(AppQDialog): class RoutingRemarkEditDialog(AppQDialog): """Present the routing remark edit dialog.""" + def __init__(self, remark: str, parent=None): """Initialize the RoutingRemarkEditDialog.""" super().__init__(parent) @@ -616,6 +623,7 @@ class RoutingRemarkEditDialog(AppQDialog): class RoutingProfileEditDialog(AppQDialog): """Present the routing profile edit dialog.""" + def __init__(self, parent=None): """Initialize the RoutingProfileEditDialog.""" super().__init__(parent) @@ -669,6 +677,7 @@ class RoutingProfileEditDialog(AppQDialog): class RoutingRulesQListWidget(AppQListWidget): """Provide the routing rules Qt list widget.""" + editRequested, deleteRequested = ( QtCore.Signal(), QtCore.Signal(), @@ -761,6 +770,7 @@ class RoutingRulesQListWidget(AppQListWidget): class RoutingRulesDialog(AppQDialog): """Present the routing rules dialog.""" + def __init__(self, routing: dict, parent=None): """Initialize the RoutingRulesDialog.""" super().__init__(parent) @@ -879,6 +889,7 @@ class RoutingRulesDialog(AppQDialog): class UserRoutingQTableViewHorizontalHeader(AppQHeaderView): """Provide the user routing Qt table view horizontal table header.""" + def __init__(self, *args, **kwargs): """Initialize the UserRoutingQTableViewHorizontalHeader.""" super().__init__(QtCore.Qt.Orientation.Horizontal, *args, **kwargs) @@ -886,6 +897,7 @@ class UserRoutingQTableViewHorizontalHeader(AppQHeaderView): class UserRoutingTableView(Mixins.QTranslatable, AppQTableView): """Represent user routing table view.""" + RowHeight = 42 def __init__(self, parent=None): @@ -1176,6 +1188,7 @@ class UserRoutingTableView(Mixins.QTranslatable, AppQTableView): class UserRoutingWindow(AppQMainWindow): """Present the user routing window.""" + DEFAULT_WINDOW_SIZE = QtCore.QSize(980, 560) def __init__(self, *args, **kwargs): diff --git a/Furious/Window/UserSubsWindow.py b/Furious/Window/UserSubsWindow.py index b70fa8b..97ee9fd 100644 --- a/Furious/Window/UserSubsWindow.py +++ b/Furious/Window/UserSubsWindow.py @@ -40,6 +40,7 @@ registerAppSettings('UserSubsWindowState') class AddSubsDialog(AppQDialog): """Present the add subs dialog.""" + def __init__(self, *args, **kwargs): """Initialize the AddSubsDialog.""" super().__init__(*args, **kwargs) @@ -85,6 +86,7 @@ class AddSubsDialog(AppQDialog): class UserSubsWindow(AppQMainWindow): """Present the user subs window.""" + DEFAULT_WINDOW_SIZE = QtCore.QSize(1120, 600) def __init__(self, *args, **kwargs): @@ -126,6 +128,7 @@ class UserSubsWindow(AppQMainWindow): def addSubs(self): """Add subs.""" + def handleResultCode(_addSubsDialog, code): """Handle result code.""" if code == PySide6Legacy.enumValueWrapper(AppQDialog.DialogCode.Accepted): diff --git a/Furious/Window/XrayAssetViewerWindow.py b/Furious/Window/XrayAssetViewerWindow.py index 65bc037..e3f8941 100644 --- a/Furious/Window/XrayAssetViewerWindow.py +++ b/Furious/Window/XrayAssetViewerWindow.py @@ -36,6 +36,7 @@ logger = logging.getLogger(__name__) class XrayAssetViewerWindow(AppQMainWindow): """Present the Xray asset viewer window.""" + def __init__(self, *args, **kwargs): """Initialize the XrayAssetViewerWindow.""" super().__init__(*args, **kwargs) diff --git a/Main.py b/Main.py index 268ca4c..11ba32a 100644 --- a/Main.py +++ b/Main.py @@ -17,6 +17,5 @@ from Furious.__main__ import main - if __name__ == '__main__': main()