Skip to content

Commit

Permalink
use single-byte chars for py example progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Mar 3, 2024
1 parent 1755503 commit 2ec4620
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples_linux/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ def __init__( # pylint: disable=too-many-arguments,invalid-name
self.x, self.y, self.width, self.win, self.color = (x, y, cols, std_scr, color)
string = label # always labeled in MHz (4 digits)
# -9 for padding, label, & signal count
string += "" * (self.width - 8) # the empty bar
string += "-" * (self.width - 8) # the empty bar
string += " - " # the initial signal count
self.win.addstr(self.y, self.x, string, self.color)

def update(self, completed: int, signal_count: int):
"""Update the progress bar."""
filled = min(CACHE_MAX, completed) / CACHE_MAX
bar = "" * int((self.width - 8) * filled)
empty = "" * (self.width - 8 - len(bar))
bar = "=" * int((self.width - 8) * filled)
empty = "-" * (self.width - 8 - len(bar))
count = "-"
if signal_count:
count = "%X" % min(0xF, signal_count)
Expand Down

0 comments on commit 2ec4620

Please sign in to comment.