Updated deprecated threading API call and updated docs

This commit is contained in:
Mark Qvist 2022-09-30 19:02:25 +02:00
parent 683881d6cd
commit c18806c912
18 changed files with 38 additions and 42 deletions

View file

@ -153,7 +153,7 @@ class AX25KISSInterface(Interface):
# Allow time for interface to initialise before config
sleep(2.0)
thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True
RNS.log("Serial port "+self.port+" is now open")

View file

@ -185,7 +185,7 @@ class AutoInterface(Interface):
self.discovery_handler(discovery_socket, ifname)
thread = threading.Thread(target=discovery_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
suitable_interfaces += 1
@ -214,11 +214,11 @@ class AutoInterface(Interface):
self.server = socketserver.UDPServer(address, handlerFactory(self.processIncoming))
thread = threading.Thread(target=self.server.serve_forever)
thread.setDaemon(True)
thread.daemon = True
thread.start()
job_thread = threading.Thread(target=self.peer_jobs)
job_thread.setDaemon(True)
job_thread.daemon = True
job_thread.start()
time.sleep(peering_wait)
@ -236,7 +236,7 @@ class AutoInterface(Interface):
self.announce_handler(ifname)
thread = threading.Thread(target=announce_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
while True:

View file

@ -457,7 +457,7 @@ class I2PInterfacePeer(Interface):
time.sleep(15)
thread = threading.Thread(target=tunnel_job)
thread.setDaemon(True)
thread.daemon = True
thread.start()
def wait_job():
@ -469,15 +469,15 @@ class I2PInterfacePeer(Interface):
if not self.connect(initial=True):
thread = threading.Thread(target=self.reconnect)
thread.setDaemon(True)
thread.daemon = True
thread.start()
else:
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
thread = threading.Thread(target=wait_job)
thread.setDaemon(True)
thread.daemon = True
thread.start()
@ -600,7 +600,7 @@ class I2PInterfacePeer(Interface):
self.reconnecting = False
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
if not self.kiss_framing:
RNS.Transport.synthesize_tunnel(self)
@ -784,7 +784,7 @@ class I2PInterface(Interface):
self.online = False
i2p_thread = threading.Thread(target=self.i2p.start)
i2p_thread.setDaemon(True)
i2p_thread.daemon = True
i2p_thread.start()
i2p_notready_warning = False
@ -809,7 +809,7 @@ class I2PInterface(Interface):
self.server = ThreadingI2PServer(self.address, handlerFactory(self.incoming_connection))
thread = threading.Thread(target=self.server.serve_forever)
thread.setDaemon(True)
thread.daemon = True
thread.start()
if self.connectable:
@ -828,7 +828,7 @@ class I2PInterface(Interface):
thread = threading.Thread(target=tunnel_job)
thread.setDaemon(True)
thread.daemon = True
thread.start()
if peers != None:

View file

@ -144,7 +144,7 @@ class KISSInterface(Interface):
# Allow time for interface to initialise before config
sleep(2.0)
thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True
RNS.log("Serial port "+self.port+" is now open")

View file

@ -92,7 +92,7 @@ class LocalClientInterface(Interface):
if connected_socket == None:
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
def connect(self):
@ -127,7 +127,7 @@ class LocalClientInterface(Interface):
self.reconnecting = False
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
RNS.Transport.shared_connection_reappeared()
@ -296,7 +296,7 @@ class LocalServerInterface(Interface):
self.server = ThreadingTCPServer(address, handlerFactory(self.incoming_connection))
thread = threading.Thread(target=self.server.serve_forever)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.announce_rate_target = None

View file

@ -96,7 +96,7 @@ class PipeInterface(Interface):
def configure_pipe(self):
sleep(0.01)
thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True
RNS.log("Subprocess pipe for "+str(self)+" is now connected", RNS.LOG_VERBOSE)

View file

@ -208,7 +208,7 @@ class RNodeInterface(Interface):
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Reticulum will attempt to bring up this interface periodically", RNS.LOG_ERROR)
thread = threading.Thread(target=self.reconnect_port)
thread.setDaemon(True)
thread.daemon = True
thread.start()
@ -232,7 +232,7 @@ class RNodeInterface(Interface):
def configure_device(self):
sleep(2.0)
thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.detect()

View file

@ -116,7 +116,7 @@ class SerialInterface(Interface):
def configure_device(self):
sleep(0.5)
thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True
RNS.log("Serial port "+self.port+" is now open", RNS.LOG_VERBOSE)

View file

@ -132,17 +132,17 @@ class TCPClientInterface(Interface):
self.initial_connect()
else:
thread = threading.Thread(target=self.initial_connect)
thread.setDaemon(True)
thread.daemon = True
thread.start()
def initial_connect(self):
if not self.connect(initial=True):
thread = threading.Thread(target=self.reconnect)
thread.setDaemon(True)
thread.daemon = True
thread.start()
else:
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
if not self.kiss_framing:
self.wants_tunnel = True
@ -254,7 +254,7 @@ class TCPClientInterface(Interface):
self.reconnecting = False
thread = threading.Thread(target=self.read_loop)
thread.setDaemon(True)
thread.daemon = True
thread.start()
if not self.kiss_framing:
RNS.Transport.synthesize_tunnel(self)
@ -467,7 +467,7 @@ class TCPServerInterface(Interface):
self.bitrate = TCPServerInterface.BITRATE_GUESS
thread = threading.Thread(target=self.server.serve_forever)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True

View file

@ -89,7 +89,7 @@ class UDPInterface(Interface):
self.server = socketserver.UDPServer(address, handlerFactory(self.processIncoming))
thread = threading.Thread(target=self.server.serve_forever)
thread.setDaemon(True)
thread.daemon = True
thread.start()
self.online = True