style: Run linter

This commit is contained in:
Paul Gauthier (aider) 2025-05-08 15:32:56 -07:00
parent d3931f67ca
commit 540b2519c2

View file

@ -267,13 +267,13 @@ class Spinner:
self.scanner_dir = 1 if self.scanner_width > 1 else 0 # 1 → right, -1 → left self.scanner_dir = 1 if self.scanner_width > 1 else 0 # 1 → right, -1 → left
# Character palette will be upgraded to Unicode if possible # Character palette will be upgraded to Unicode if possible
self.scanner_head_char = "#" # One char per head position self.scanner_head_char = "#" # One char per head position
self.trail_active_char = "=" # Recently-visited positions self.trail_active_char = "=" # Recently-visited positions
self.trail_empty_char = "-" # Background self.trail_empty_char = "-" # Background
# Visual lengths (number of logical positions) # Visual lengths (number of logical positions)
self.scanner_head_length = 2 # "≡≡" self.scanner_head_length = 2 # "≡≡"
self.trail_active_length = 2 # "══" self.trail_active_length = 2 # "══"
# Upgrade to Unicode glyphs when the terminal supports them # Upgrade to Unicode glyphs when the terminal supports them
if self.is_tty: if self.is_tty:
@ -322,9 +322,9 @@ class Spinner:
# Add the active trail directly behind the head # Add the active trail directly behind the head
for i in range(1, self.trail_active_length + 1): for i in range(1, self.trail_active_length + 1):
if self.scanner_dir > 0: # moving right → trail to the left if self.scanner_dir > 0: # moving right → trail to the left
pos = head_start - i pos = head_start - i
else: # moving left → trail to the right else: # moving left → trail to the right
pos = head_end + i pos = head_end + i
if 0 <= pos < self.scanner_width and frame_chars[pos] == self.trail_empty_char: if 0 <= pos < self.scanner_width and frame_chars[pos] == self.trail_empty_char:
frame_chars[pos] = self.trail_active_char frame_chars[pos] = self.trail_active_char
@ -339,7 +339,10 @@ class Spinner:
# Advance for next frame # Advance for next frame
if self.scanner_width > self.scanner_head_length: if self.scanner_width > self.scanner_head_length:
self.scanner_pos += self.scanner_dir self.scanner_pos += self.scanner_dir
if self.scanner_dir > 0 and self.scanner_pos >= self.scanner_width - self.scanner_head_length: if (
self.scanner_dir > 0
and self.scanner_pos >= self.scanner_width - self.scanner_head_length
):
self.scanner_pos = self.scanner_width - self.scanner_head_length self.scanner_pos = self.scanner_width - self.scanner_head_length
self.scanner_dir = -1 self.scanner_dir = -1
elif self.scanner_dir < 0 and self.scanner_pos <= 0: elif self.scanner_dir < 0 and self.scanner_pos <= 0: