diff options
author | Micah Lee <micah@micahflee.com> | 2020-08-27 18:21:03 -0400 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-08-27 18:21:03 -0400 |
commit | d4a362f18959eb8b8b5523289fd3935427900450 (patch) | |
tree | bd1715cd27bcafa212af7d6a262795f5b3f29e13 /onionshare | |
parent | 74a945620fb9506d18ef0859540e1e5fcb122ead (diff) | |
download | onionshare-d4a362f18959eb8b8b5523289fd3935427900450.tar.gz onionshare-d4a362f18959eb8b8b5523289fd3935427900450.zip |
Make connecting to Tor CLI progress all display on the same line
Diffstat (limited to 'onionshare')
-rw-r--r-- | onionshare/onion.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/onionshare/onion.py b/onionshare/onion.py index 614fa76e..faffdd52 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -374,7 +374,10 @@ class Onion(object): summary = res_parts[4].split("=")[1] # "\033[K" clears the rest of the line - print(f"Connecting to the Tor network: {progress}% - {summary}\033[K") + print( + f"\rConnecting to the Tor network: {progress}% - {summary}\033[K", + end="", + ) if callable(tor_status_update_func): if not tor_status_update_func(progress, summary): @@ -552,8 +555,11 @@ class Onion(object): # Do the versions of stem and tor that I'm using support stealth onion services? try: res = self.c.create_ephemeral_hidden_service( - {1: 1}, basic_auth={"onionshare": None}, await_publication=False, - key_type="NEW",key_content="RSA1024" + {1: 1}, + basic_auth={"onionshare": None}, + await_publication=False, + key_type="NEW", + key_content="RSA1024", ) tmp_service_id = res.service_id self.c.remove_ephemeral_hidden_service(tmp_service_id) |