Skip to content

Commit

Permalink
adjust scanner.py string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Mar 7, 2024
1 parent fcad232 commit 0cf9bed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples_linux/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ 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)
self.win.move(self.y, self.x)
self.win.attron(curses.color_pair(self.color))
self.win.addstr(label) # always labeled in MHz (4 digits)
self.win.addstr(label + " ") # always labeled in MHz (4 digits)
for _ in range(self.width - 8): # draw the empty bar
self.win.addch(curses.ACS_HLINE)
self.win.addstr(" - ") # draw the initial signal count
self.win.attroff(curses.color_pair(self.color))

def update(self, completed: int, signal_count: int):
"""Update the progress bar."""
count = "-"
count = " - "
if signal_count:
count = "%X" % min(0xF, signal_count)
count = " %X " % min(0xF, signal_count)
filled = (self.width - 8) * completed / CACHE_MAX
offset_x = 5
self.win.move(self.y, self.x + offset_x)
Expand All @@ -92,7 +92,7 @@ def update(self, completed: int, signal_count: int):
self.win.addch("=" if bar_filled else curses.ACS_HLINE)
self.win.attroff(curses.color_pair(bar_color))
self.win.attron(curses.color_pair(self.color))
self.win.addstr(f" {count} ")
self.win.addstr(count)
self.win.attroff(curses.color_pair(self.color))


Expand Down

0 comments on commit 0cf9bed

Please sign in to comment.