Skip to content

Commit ebc0012

Browse files
committed
- adding log.asked_to_stop to avoid status bar update after exit is
requested - PR #85 integrated in devel branch
1 parent cfe8415 commit ebc0012

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pyradio/log.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class Log(object):
1414
last_written_string = ''
1515
display_help_message = False
1616

17+
asked_to_stop = False
18+
1719
def __init__(self):
1820
self.width = None
1921

@@ -26,6 +28,8 @@ def setScreen(self, cursesScreen):
2628
self.write(self.msg)
2729

2830
def write(self, msg, thread_lock=None, help_msg=False):
31+
if self.asked_to_stop:
32+
return
2933
""" msg may or may not be encoded """
3034
if self.cursesScreen:
3135
if thread_lock is not None:
@@ -55,6 +59,8 @@ def write(self, msg, thread_lock=None, help_msg=False):
5559
self.display_help_message = True
5660

5761
def write_right(self, msg, thread_lock=None):
62+
if self.asked_to_stop:
63+
return
5864
""" msg may or may not be encoded """
5965
if self.cursesScreen:
6066
if thread_lock is not None:

pyradio/radio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def initBody(self):
416416
the "help" directory.'''
417417
else:
418418
if self.requested_player:
419-
txt = """Rypadio is not able to use the player you specified.
419+
txt = """RyRadio is not able to use the player you specified.
420420
421421
This means that either this particular player is not supported
422422
by PyRadio, or that you have simply misspelled its name.
@@ -608,7 +608,7 @@ def run(self):
608608
else:
609609
self._register_windows_handlers()
610610

611-
# start update thread
611+
# start update detection and notification thread
612612
if CAN_CHECK_FOR_UPDATES:
613613
if self._cnf.locked:
614614
if logger.isEnabledFor(logging.INFO):
@@ -3076,6 +3076,8 @@ def keypress(self, char):
30763076
return
30773077
else:
30783078
""" exit """
3079+
# stop updating the status bar
3080+
self.log.asked_to_stop = True
30793081
if self._cnf.dirty_playlist:
30803082
if self._cnf.auto_save_playlist:
30813083
# save playlist and exit

0 commit comments

Comments
 (0)