1
+ """
2
+ src/network/proxy.py
3
+ ====================
4
+ """
5
+ # pylint: disable=protected-access
1
6
import socket
2
7
import time
3
8
@@ -56,7 +61,7 @@ def proxy(self):
56
61
def proxy (self , address ):
57
62
"""Set proxy IP and port"""
58
63
if (not isinstance (address , tuple ) or len (address ) < 2 or
59
- not isinstance (address [0 ], str ) or
64
+ not isinstance (address [0 ], str ) or
60
65
not isinstance (address [1 ], int )):
61
66
raise ValueError
62
67
self .__class__ ._proxy = address
@@ -83,8 +88,8 @@ def onion_proxy(self):
83
88
def onion_proxy (self , address ):
84
89
"""Set onion proxy address"""
85
90
if address is not None and (
86
- not isinstance (address , tuple ) or len (address ) < 2 or
87
- not isinstance (address [0 ], str ) or
91
+ not isinstance (address , tuple ) or len (address ) < 2 or
92
+ not isinstance (address [0 ], str ) or
88
93
not isinstance (address [1 ], int )):
89
94
raise ValueError
90
95
self .__class__ ._onion_proxy = address
@@ -138,5 +143,5 @@ def handle_connect(self):
138
143
139
144
def state_proxy_handshake_done (self ):
140
145
"""Handshake is complete at this point"""
141
- self .connectedAt = time .time ()
146
+ self .connectedAt = time .time () # pylint: disable=attribute-defined-outside-init
142
147
return False
0 commit comments