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 # Allow time for interface to initialise before config
sleep(2.0) sleep(2.0)
thread = threading.Thread(target=self.readLoop) thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
self.online = True self.online = True
RNS.log("Serial port "+self.port+" is now open") RNS.log("Serial port "+self.port+" is now open")

View File

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

View File

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

View File

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

View File

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

View File

@ -96,7 +96,7 @@ class PipeInterface(Interface):
def configure_pipe(self): def configure_pipe(self):
sleep(0.01) sleep(0.01)
thread = threading.Thread(target=self.readLoop) thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
self.online = True self.online = True
RNS.log("Subprocess pipe for "+str(self)+" is now connected", RNS.LOG_VERBOSE) 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("The contained exception was: "+str(e), RNS.LOG_ERROR)
RNS.log("Reticulum will attempt to bring up this interface periodically", 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 = threading.Thread(target=self.reconnect_port)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
@ -232,7 +232,7 @@ class RNodeInterface(Interface):
def configure_device(self): def configure_device(self):
sleep(2.0) sleep(2.0)
thread = threading.Thread(target=self.readLoop) thread = threading.Thread(target=self.readLoop)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
self.detect() self.detect()

View File

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

View File

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

View File

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

View File

@ -283,7 +283,7 @@ class Link:
self.activated_at = time.time() self.activated_at = time.time()
if self.callbacks.link_established != None: if self.callbacks.link_established != None:
thread = threading.Thread(target=self.callbacks.link_established, args=(self,)) thread = threading.Thread(target=self.callbacks.link_established, args=(self,))
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
else: else:
RNS.log("Invalid link proof signature received by "+str(self)+". Ignoring.", RNS.LOG_DEBUG) RNS.log("Invalid link proof signature received by "+str(self)+". Ignoring.", RNS.LOG_DEBUG)
@ -471,7 +471,7 @@ class Link:
def start_watchdog(self): def start_watchdog(self):
thread = threading.Thread(target=self.__watchdog_job) thread = threading.Thread(target=self.__watchdog_job)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
def __watchdog_job(self): def __watchdog_job(self):
@ -641,7 +641,7 @@ class Link:
plaintext = self.decrypt(packet.data) plaintext = self.decrypt(packet.data)
if self.callbacks.packet != None: if self.callbacks.packet != None:
thread = threading.Thread(target=self.callbacks.packet, args=(plaintext, packet)) thread = threading.Thread(target=self.callbacks.packet, args=(plaintext, packet))
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
if self.destination.proof_strategy == RNS.Destination.PROVE_ALL: if self.destination.proof_strategy == RNS.Destination.PROVE_ALL:
@ -982,7 +982,7 @@ class RequestReceipt():
self.status = RequestReceipt.DELIVERED self.status = RequestReceipt.DELIVERED
self.__resource_response_timeout = time.time()+self.timeout self.__resource_response_timeout = time.time()+self.timeout
response_timeout_thread = threading.Thread(target=self.__response_timeout_job) response_timeout_thread = threading.Thread(target=self.__response_timeout_job)
response_timeout_thread.setDaemon(True) response_timeout_thread.daemon = True
response_timeout_thread.start() response_timeout_thread.start()
else: else:
RNS.log("Sending request "+RNS.prettyhexrep(self.request_id)+" as resource failed with status: "+RNS.hexrep([resource.status]), RNS.LOG_DEBUG) RNS.log("Sending request "+RNS.prettyhexrep(self.request_id)+" as resource failed with status: "+RNS.hexrep([resource.status]), RNS.LOG_DEBUG)

View File

@ -494,7 +494,7 @@ class PacketReceipt:
if self.callbacks.timeout: if self.callbacks.timeout:
thread = threading.Thread(target=self.callbacks.timeout, args=(self,)) thread = threading.Thread(target=self.callbacks.timeout, args=(self,))
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()

View File

@ -393,7 +393,7 @@ class Resource:
the resource advertisement it will begin transferring. the resource advertisement it will begin transferring.
""" """
thread = threading.Thread(target=self.__advertise_job) thread = threading.Thread(target=self.__advertise_job)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
def __advertise_job(self): def __advertise_job(self):
@ -421,7 +421,7 @@ class Resource:
def watchdog_job(self): def watchdog_job(self):
thread = threading.Thread(target=self.__watchdog_job) thread = threading.Thread(target=self.__watchdog_job)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
def __watchdog_job(self): def __watchdog_job(self):

View File

@ -259,7 +259,7 @@ class Reticulum:
if self.is_shared_instance: if self.is_shared_instance:
self.rpc_listener = multiprocessing.connection.Listener(self.rpc_addr, authkey=self.rpc_key) self.rpc_listener = multiprocessing.connection.Listener(self.rpc_addr, authkey=self.rpc_key)
thread = threading.Thread(target=self.rpc_loop) thread = threading.Thread(target=self.rpc_loop)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
atexit.register(Reticulum.exit_handler) atexit.register(Reticulum.exit_handler)
@ -269,7 +269,7 @@ class Reticulum:
def __start_jobs(self): def __start_jobs(self):
if self.jobs_thread == None: if self.jobs_thread == None:
self.jobs_thread = threading.Thread(target=self.__jobs) self.jobs_thread = threading.Thread(target=self.__jobs)
self.jobs_thread.setDaemon(True) self.jobs_thread.daemon = True
self.jobs_thread.start() self.jobs_thread.start()
def __jobs(self): def __jobs(self):

View File

@ -165,7 +165,7 @@ class Transport:
Transport.jobs_running = False Transport.jobs_running = False
thread = threading.Thread(target=Transport.jobloop) thread = threading.Thread(target=Transport.jobloop)
thread.setDaemon(True) thread.daemon = True
thread.start() thread.start()
if RNS.Reticulum.transport_enabled(): if RNS.Reticulum.transport_enabled():

Binary file not shown.

View File

@ -18,7 +18,3 @@ dt.sig {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
margin-top: 1.75rem; margin-top: 1.75rem;
} }
div.bottom-of-page div.left-details:not(:first-child) {
display: none !important;
}

File diff suppressed because one or more lines are too long