Skip to content

Commit 3800f91

Browse files
committed
Remove some bad coding
while True and ...
2 parents 5f01d06 + ed10230 commit 3800f91

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

python/inputmodule/gui/ledmatrix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def countdown(dev, seconds):
2525
set_status('countdown')
2626
start = datetime.now()
2727
target = seconds * 1_000_000
28-
while True and get_status() == 'countdown':
28+
while get_status() == 'countdown':
2929
if is_thread_stopped() or is_dev_disconnected(dev.device):
3030
reset_thread()
3131
return
@@ -51,7 +51,7 @@ def blinking(dev):
5151
"""Blink brightness high/off every second.
5252
Keeps currently displayed grid"""
5353
set_status('blinking')
54-
while True and get_status() == 'blinking':
54+
while get_status() == 'blinking':
5555
if is_thread_stopped() or is_dev_disconnected(dev.device):
5656
reset_thread()
5757
return
@@ -65,7 +65,7 @@ def random_eq(dev):
6565
"""Display an equlizer looking animation with random values."""
6666
animate(dev, False)
6767
set_status('random_eq')
68-
while True and get_status() == 'random_eq':
68+
while get_status() == 'random_eq':
6969
if is_thread_stopped() or is_dev_disconnected(dev.device):
7070
reset_thread()
7171
return
@@ -82,7 +82,7 @@ def clock(dev):
8282
Loops forever, updating every second"""
8383
animate(dev, False)
8484
set_status('clock')
85-
while True and get_status() == 'clock':
85+
while get_status() == 'clock':
8686
if is_thread_stopped() or is_dev_disconnected(dev.device):
8787
reset_thread()
8888
return

python/inputmodule/inputmodule/ledmatrix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def camera(dev):
124124
end_x = min(dim[1], start_x + WIDTH)
125125

126126
# Pre-process the video into resized, cropped, grayscale frames
127-
while True and get_status() == 'camera':
127+
while get_status() == 'camera':
128128
ret, frame = capture.read()
129129
if not ret:
130130
print("Failed to capture video frames")
@@ -166,7 +166,7 @@ def video(dev, video_file):
166166
processed = []
167167

168168
# Pre-process the video into resized, cropped, grayscale frames
169-
while True and get_status() == 'video':
169+
while get_status() == 'video':
170170
ret, frame = capture.read()
171171
if not ret:
172172
print("Failed to read video frames")
@@ -301,7 +301,7 @@ def breathing(dev):
301301
Keeps currently displayed grid"""
302302
set_status('breathing')
303303
# Bright ranges appear similar, so we have to go through those faster
304-
while True and get_status() == 'breathing':
304+
while get_status() == 'breathing':
305305
# Go quickly from 250 to 50
306306
for i in range(10):
307307
time.sleep(0.03)

0 commit comments

Comments
 (0)