From 05e0b17fbf925bc9fdf47270fbf17ce63780e960 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 24 Sep 2021 16:49:07 +0200 Subject: [PATCH] Improved rnprobe utility output. --- RNS/Utilities/rnprobe.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/RNS/Utilities/rnprobe.py b/RNS/Utilities/rnprobe.py index 85d8575..6308083 100644 --- a/RNS/Utilities/rnprobe.py +++ b/RNS/Utilities/rnprobe.py @@ -34,6 +34,13 @@ def program_setup(configdir, destination_hexhash, size=DEFAULT_PROBE_SIZE, full_ print(str(e)) exit() + if verbosity > 0: + more_output = True + verbosity -= 1 + else: + more_output = False + verbosity -= 1 + reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity) @@ -63,7 +70,12 @@ def program_setup(configdir, destination_hexhash, size=DEFAULT_PROBE_SIZE, full_ probe = RNS.Packet(request_destination, os.urandom(size)) receipt = probe.send() - print("\rSent "+str(size)+" byte probe to "+RNS.prettyhexrep(destination_hash)+" via "+RNS.prettyhexrep(RNS.Transport.next_hop(destination_hash))+" on "+str(RNS.Transport.next_hop_interface(destination_hash))+" ", end=" ") + if more_output: + more = " via "+RNS.prettyhexrep(RNS.Transport.next_hop(destination_hash))+" on "+str(RNS.Transport.next_hop_interface(destination_hash)) + else: + more = "" + + print("\rSent "+str(size)+" byte probe to "+RNS.prettyhexrep(destination_hash)+more+" ", end=" ") i = 0 while not receipt.status == RNS.PacketReceipt.DELIVERED: