mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-22 13:40:19 +00:00
Improved rncp progress status display
This commit is contained in:
parent
035a44e34d
commit
96527380c3
@ -493,7 +493,8 @@ def fetch(configdir, verbosity = 0, quietness = 0, destination = None, file = No
|
|||||||
if silent:
|
if silent:
|
||||||
print(str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
print(str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
||||||
else:
|
else:
|
||||||
print("\r \r"+str(file)+" fetched from "+RNS.prettyhexrep(destination_hash))
|
#print("\r \r"+str(file)+" fetched from "+RNS.prettyhexrep(destination_hash))
|
||||||
|
print("\n"+str(file)+" fetched from "+RNS.prettyhexrep(destination_hash))
|
||||||
link.teardown()
|
link.teardown()
|
||||||
time.sleep(0.15)
|
time.sleep(0.15)
|
||||||
exit(0)
|
exit(0)
|
||||||
@ -648,15 +649,19 @@ def send(configdir, verbosity = 0, quietness = 0, destination = None, file = Non
|
|||||||
else:
|
else:
|
||||||
print("\r \rTransferring file ", end=" ")
|
print("\r \rTransferring file ", end=" ")
|
||||||
|
|
||||||
|
def progress_update(i):
|
||||||
|
time.sleep(0.1)
|
||||||
|
prg = current_resource.get_progress()
|
||||||
|
percent = round(prg * 100.0, 1)
|
||||||
|
stat_str = str(percent)+"% - " + size_str(int(prg*current_resource.total_size)) + " of " + size_str(current_resource.total_size) + " - " +size_str(speed, "b")+"ps"
|
||||||
|
print("\r \rTransferring file "+syms[i]+" "+stat_str, end=" ")
|
||||||
|
sys.stdout.flush()
|
||||||
|
i = (i+1)%len(syms)
|
||||||
|
return i
|
||||||
|
|
||||||
while not resource_done:
|
while not resource_done:
|
||||||
if not silent:
|
if not silent:
|
||||||
time.sleep(0.1)
|
i = progress_update(i)
|
||||||
prg = current_resource.get_progress()
|
|
||||||
percent = round(prg * 100.0, 1)
|
|
||||||
stat_str = str(percent)+"% - " + size_str(int(prg*current_resource.total_size)) + " of " + size_str(current_resource.total_size) + " - " +size_str(speed, "b")+"ps"
|
|
||||||
print("\r \rTransferring file "+syms[i]+" "+stat_str, end=" ")
|
|
||||||
sys.stdout.flush()
|
|
||||||
i = (i+1)%len(syms)
|
|
||||||
|
|
||||||
if current_resource.status != RNS.Resource.COMPLETE:
|
if current_resource.status != RNS.Resource.COMPLETE:
|
||||||
if silent:
|
if silent:
|
||||||
@ -668,7 +673,8 @@ def send(configdir, verbosity = 0, quietness = 0, destination = None, file = Non
|
|||||||
if silent:
|
if silent:
|
||||||
print(str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
print(str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
||||||
else:
|
else:
|
||||||
print("\r \r"+str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
# print("\r \r"+str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
||||||
|
print("\n"+str(file_path)+" copied to "+RNS.prettyhexrep(destination_hash))
|
||||||
link.teardown()
|
link.teardown()
|
||||||
time.sleep(0.25)
|
time.sleep(0.25)
|
||||||
real_file.close()
|
real_file.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user