Addressed pylint too-many-positional-arguments in i2p,
simplified I2PDialer instantiation.
This commit is contained in:
parent
3541f15922
commit
e8dcbd3753
|
@ -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))
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user