Skip to content

Commit

Permalink
Remove try/excepts that were for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Oct 6, 2023
1 parent bb7acc8 commit 42ce00f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
5 changes: 1 addition & 4 deletions nurses_2/widgets/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ def _paint_small_vertical_bar(self, progress):
smooth_bar = smooth_vertical_bar(bar_height, 1, offset)

self.canvas[:] = style_char(self.default_char)
try:
self.canvas["char"][::-1][y : y + len(smooth_bar)].T[:] = smooth_bar
except Exception as e:
raise SystemExit(bar_height, progress, offset, smooth_bar) from e
self.canvas["char"][::-1][y : y + len(smooth_bar)].T[:] = smooth_bar
self.colors[:] = self.color_theme.progress_bar
if offset != 0:
self.colors[::-1][y] = self.color_theme.progress_bar.reversed()
Expand Down
31 changes: 14 additions & 17 deletions nurses_2/widgets/text_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,26 +269,23 @@ def on_remove(self):
super().on_remove()

async def _play_animation(self):
try:
while self.frames:
await asyncio.sleep(self.frame_durations[self._i])
while self.frames:
await asyncio.sleep(self.frame_durations[self._i])

if self.reverse:
self._i -= 1
if self._i < 0:
self._i = len(self.frames) - 1
if self.reverse:
self._i -= 1
if self._i < 0:
self._i = len(self.frames) - 1

if not self.loop:
return
else:
self._i += 1
if self._i == len(self.frames):
self._i = 0
if not self.loop:
return
else:
self._i += 1
if self._i == len(self.frames):
self._i = 0

if not self.loop:
return
except Exception as e:
raise SystemExit(e)
if not self.loop:
return

def play(self) -> asyncio.Task:
"""
Expand Down

0 comments on commit 42ce00f

Please sign in to comment.