Skip to content

Commit

Permalink
Fixed rncp fstrings for Android build
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Oct 9, 2024
1 parent c9a2b45 commit 8d7857c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions RNS/Utilities/rncp.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,14 @@ def fetch_resource_concluded(resource):
prg = current_resource.get_progress()
percent = round(prg * 100.0, 1)
if show_phy_rates:
phy_str = f" ({size_str(phy_speed, "b")}ps at physical layer)"
pss = size_str(phy_speed, "b")
phy_str = f" ({pss}ps at physical layer)"
else:
phy_str = ""
stat_str = f"{percent}% - {size_str(int(prg*current_resource.total_size))} of {size_str(current_resource.total_size)} - {size_str(speed, "b")}ps{phy_str}"
ps = size_str(int(prg*current_resource.total_size))
ts = size_str(current_resource.total_size)
ss = size_str(speed, "b")
stat_str = f"{percent}% - {ps} of {ts} - {ss}ps{phy_str}"
if prg != 1.0:
print(f"{erase_str}Transferring file {syms[i]} {stat_str}", end=es)
else:
Expand Down Expand Up @@ -693,11 +697,15 @@ def progress_update(i, done=False):
prg = current_resource.get_progress()
percent = round(prg * 100.0, 1)
if show_phy_rates:
phy_str = f" ({size_str(phy_speed, "b")}ps at physical layer)"
pss = size_str(phy_speed, "b")
phy_str = f" ({pss}ps at physical layer)"
else:
phy_str = ""
es = " "
stat_str = f"{percent}% - {size_str(int(prg*current_resource.total_size))} of {size_str(current_resource.total_size)} - {size_str(speed, "b")}ps{phy_str}"
cs = size_str(int(prg*current_resource.total_size))
ts = size_str(current_resource.total_size)
ss = size_str(speed, "b")
stat_str = f"{percent}% - {cs} of {ts} - {ss}ps{phy_str}"
if not done:
print(f"{erase_str}Transferring file "+syms[i]+" "+stat_str, end=es)
else:
Expand Down

0 comments on commit 8d7857c

Please sign in to comment.