Addressed pylint too-many-positional-arguments in i2p,

simplified I2PDialer instantiation.
This commit is contained in:
Lee Miller 2024-10-22 02:02:04 +03:00
parent 333af9169c
commit 09c0736817
Signed by: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
2 changed files with 6 additions and 8 deletions

View File

@ -7,14 +7,15 @@ from .util import I2PThread
class I2PDialer(I2PThread): class I2PDialer(I2PThread):
def __init__( def __init__(
self, state, destination, nick, sam_host='127.0.0.1', sam_port=7656 self, state, destination, nick=None, *, sam_host=None, sam_port=None
): ):
self.sam_host = sam_host # Initially 127.0.0.1:7656
self.sam_port = sam_port self.sam_host = sam_host or state.i2p_sam_host
self.sam_port = sam_port or state.i2p_sam_port
self.nick = nick
self.destination = destination self.destination = destination
self.nick = nick or state.i2p_session_nick
super().__init__(state, name='I2P Dial to {}'.format(self.destination)) super().__init__(state, name='I2P Dial to {}'.format(self.destination))

View File

@ -156,10 +156,7 @@ class Manager(threading.Thread):
if port == 'i2p' and shared.i2p_enabled: if port == 'i2p' and shared.i2p_enabled:
if shared.i2p_session_nick and host != shared.i2p_dest_pub: if shared.i2p_session_nick and host != shared.i2p_dest_pub:
try: try:
d = I2PDialer( d = I2PDialer(shared, host)
shared,
host, shared.i2p_session_nick,
shared.i2p_sam_host, shared.i2p_sam_port)
d.start() d.start()
hosts.add(d.destination) hosts.add(d.destination)
shared.i2p_dialers.add(d) shared.i2p_dialers.add(d)