Add terminal animation while waiting for circuits to close

This commit is contained in:
Micah Lee 2020-11-27 11:27:11 -08:00
parent 7927ef83b2
commit 6d38b8e0c4
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -767,6 +767,9 @@ class Onion(object):
):
rendevouz_circuit_ids.append(c.id)
symbols = [c for c in "\\|/-"]
symbols_i = 0
while True:
num_rend_circuits = 0
for c in self.c.get_circuits():
@ -782,9 +785,10 @@ class Onion(object):
else:
circuits = "circuits"
print(
f"\rWaiting for {num_rend_circuits} Tor rendezvous {circuits} to close ... ",
f"\rWaiting for {num_rend_circuits} Tor rendezvous {circuits} to close {symbols[symbols_i]} ",
end="",
)
symbols_i = (symbols_i + 1) % len(symbols)
time.sleep(1)
except:
pass