Code quality

This commit is contained in:
Peter Šurda 2021-06-02 15:49:07 +08:00 committed by Peter Šurda
parent bb9065ee07
commit 26962e57e3
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95
2 changed files with 10 additions and 2 deletions

View File

@ -44,7 +44,7 @@ else:
class TLSDispatcher(AdvancedDispatcher): class TLSDispatcher(AdvancedDispatcher):
"""TLS functionality for classes derived from AdvancedDispatcher""" """TLS functionality for classes derived from AdvancedDispatcher"""
# pylint: disable=too-many-instance-attributes, too-many-arguments # pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=super-init-not-called # pylint: disable=super-init-not-called, unused-argument
def __init__(self, _=None, sock=None, certfile=None, keyfile=None, def __init__(self, _=None, sock=None, certfile=None, keyfile=None,
server_side=False, ciphers=sslProtocolCiphers): server_side=False, ciphers=sslProtocolCiphers):
self.want_read = self.want_write = True self.want_read = self.want_write = True

View File

@ -21,7 +21,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
port = 8444 port = 8444
def __init__(self, host=None, sock=None, announcing=False): def __init__(self, host=None, sock=None, announcing=False):
# pylint: disable=bad-super-call # pylint: disable=bad-super-call, access-member-before-definition
super(BMProto, self).__init__(sock=sock) super(BMProto, self).__init__(sock=sock)
self.verackReceived = True self.verackReceived = True
self.verackSent = True self.verackSent = True
@ -97,22 +97,30 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
time.time() time.time()
return True return True
# override the protocol do ignore the following commands on UDP
# we do this mainly for security reasons
def bm_command_portcheck(self): def bm_command_portcheck(self):
# pylint: disable=no-self-use
return True return True
def bm_command_ping(self): def bm_command_ping(self):
# pylint: disable=no-self-use
return True return True
def bm_command_pong(self): def bm_command_pong(self):
# pylint: disable=no-self-use
return True return True
def bm_command_verack(self): def bm_command_verack(self):
# pylint: disable=no-self-use
return True return True
def bm_command_version(self): def bm_command_version(self):
# pylint: disable=no-self-use
return True return True
def handle_connect(self): def handle_connect(self):
# pylint: disable=no-self-use
return return
def writable(self): def writable(self):