From e8dcbd375317952c208678197f582c826837dd9b Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Tue, 22 Oct 2024 02:02:04 +0300 Subject: [PATCH] Addressed pylint too-many-positional-arguments in i2p, simplified I2PDialer instantiation. --- minode/i2p/dialer.py | 9 +++++---- minode/manager.py | 5 +---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/minode/i2p/dialer.py b/minode/i2p/dialer.py index a426fcb..36e4aa0 100644 --- a/minode/i2p/dialer.py +++ b/minode/i2p/dialer.py @@ -7,14 +7,15 @@ from .util import I2PThread class I2PDialer(I2PThread): 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 - self.sam_port = sam_port + # Initially 127.0.0.1:7656 + 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.nick = nick or state.i2p_session_nick super().__init__(state, name='I2P Dial to {}'.format(self.destination)) diff --git a/minode/manager.py b/minode/manager.py index aa8bbf9..612fcc1 100644 --- a/minode/manager.py +++ b/minode/manager.py @@ -156,10 +156,7 @@ class Manager(threading.Thread): if port == 'i2p' and shared.i2p_enabled: if shared.i2p_session_nick and host != shared.i2p_dest_pub: try: - d = I2PDialer( - shared, - host, shared.i2p_session_nick, - shared.i2p_sam_host, shared.i2p_sam_port) + d = I2PDialer(shared, host) d.start() hosts.add(d.destination) shared.i2p_dialers.add(d)