Normalize application naming

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-08-19 15:03:55 +08:00
parent 43bfaf7b65
commit 4269dc217e
49 changed files with 348 additions and 350 deletions
+5 -5
View File
@@ -52,7 +52,7 @@ def dictRepr(returncode, stdout, stderr):
class SystemRoutingTable:
"""Represent system routing table."""
Relations = list()
managedRoutes = list()
DEFAULT_GATEWAY_WIN32 = re.compile(
r'0\.0\.0\.0.\s*0\.0\.0\.0.\s*(\S+)\s*(\S+)',
@@ -121,7 +121,7 @@ class SystemRoutingTable:
@staticmethod
def addRelations():
"""Add relations."""
for sourceIP, destinationIP in SystemRoutingTable.Relations:
for sourceIP, destinationIP in SystemRoutingTable.managedRoutes:
SystemRoutingTable.add(sourceIP, destinationIP)
@staticmethod
@@ -689,13 +689,13 @@ class SystemRoutingTable:
def deleteRelations(clear=True):
"""Delete relations."""
if PLATFORM == 'Windows':
if len(SystemRoutingTable.Relations):
if len(SystemRoutingTable.managedRoutes):
SystemRoutingTable.delete(
'0.0.0.0', APPLICATION_TUN2SOCKS_GATEWAY_ADDRESS
)
for sourceIP, destinationIP in SystemRoutingTable.Relations[::-1]:
for sourceIP, destinationIP in SystemRoutingTable.managedRoutes[::-1]:
SystemRoutingTable.delete(sourceIP, destinationIP)
if clear:
SystemRoutingTable.Relations.clear()
SystemRoutingTable.managedRoutes.clear()