1
0

kill old-style namedtuples

This commit is contained in:
SomberNight
2018-10-28 00:28:29 +02:00
parent 34569d172f
commit 9037f25da1
8 changed files with 74 additions and 48 deletions

View File

@@ -110,11 +110,12 @@ def pick_random_server(hostmap = None, protocol = 's', exclude_set = set()):
return random.choice(eligible) if eligible else None
NetworkParameters = NamedTuple("NetworkParameters", [("host", str),
("port", str),
("protocol", str),
("proxy", Optional[dict]),
("auto_connect", bool)])
class NetworkParameters(NamedTuple):
host: str
port: str
protocol: str
proxy: Optional[dict]
auto_connect: bool
proxy_modes = ['socks4', 'socks5']