Skip to content

Commit 5315836

Browse files
committed
Version 0.8.2 - fixing regressions from 0.8.1
1 parent afbb72d commit 5315836

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

Changelog

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
2019-10-20 s-n-g
2+
* Version 0.8.2
3+
* Fixing chars H,L,M rejected by line editor
4+
* Fixing station editor rejecting "\?"
5+
* Updating station's editor help messages
6+
17
2019-10-19 s-n-g
28
* Version 0.8.1
3-
* CJK Unified Ideographs supported by the line edittor
9+
* CJK Unified Ideographs supported by the line editor
410
* On python 2, trying to edit a station whose name contains
511
non-ASCII characters is prohibited and will end up in
612
displaying a relevant message

pyradio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 8, 1)
3+
version_info = (0, 8, 2)
44

55
__version__ = version = '.'.join(map(str, version_info))
66
__project__ = __name__

pyradio/edit.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,6 @@ def keypress(self, char):
480480
elif char == ord('s') and self._focus > 1:
481481
ret = self._return_station()
482482
self.focus = abs(ret + 2)
483-
elif char == ord('?') and self.focus <= 1:
484-
ret = 2
485483
elif (char in (curses.ascii.DC2, 18) and not self._adding) or \
486484
(char == ord('r') and not self._adding and self.focus >1):
487485
# ^R, revert to saved
@@ -502,10 +500,7 @@ def keypress(self, char):
502500
-1: cancel
503501
"""
504502
ret = self._line_editor[self._focus].keypress(self._win, char)
505-
if ret == 2:
506-
# display help
507-
ret = 2
508-
elif ret == 1:
503+
if ret == 1:
509504
# get next char
510505
ret = 0
511506
elif ret == 0:

pyradio/radio.py

+32-33
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ def _show_line_editor_help(self):
11961196
DEL|,|^D |Delete character.
11971197
Backspace|,|^H |Backspace (delete previous character).
11981198
Up| / |Down |Go to previous / next field.
1199+
\\?| / |\\\\ |Insert a "|?|" or a "|\\|", respectively.
11991200
Esc |Cancel operation.
12001201
12011202
|Managing player volume does not work in editing mode.
@@ -1209,6 +1210,7 @@ def _show_line_editor_help(self):
12091210
DEL|,|^D |Delete character.
12101211
Backspace|,|^H |Backspace (delete previous character).
12111212
Up| / |Down |Go to previous / next field.
1213+
\\?| / |\\\\ |Insert a "|?|" or a "|\\|", respectively.
12121214
Esc |Cancel operation.
12131215
12141216
|Managing player volume does not work in editing mode.
@@ -2064,41 +2066,38 @@ def keypress(self, char):
20642066
""" if no player, don't serve keyboard """
20652067
return
20662068

2067-
elif char == ord('H'):
2068-
if self.ws.operation_mode in \
2069-
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2070-
self.jumpnr = ''
2071-
self._random_requested = False
2072-
if self.number_of_items > 0:
2073-
self.selection = self.startPos
2074-
self.refreshBody()
2075-
return
2069+
elif char == ord('H') and self.ws.operation_mode in \
2070+
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2071+
self.jumpnr = ''
2072+
self._random_requested = False
2073+
if self.number_of_items > 0:
2074+
self.selection = self.startPos
2075+
self.refreshBody()
2076+
return
20762077

2077-
elif char == ord('M'):
2078-
if self.ws.operation_mode in \
2079-
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2080-
self.jumpnr = ''
2081-
self._random_requested = False
2082-
if self.number_of_items > 0:
2083-
if self.number_of_items < self.bodyMaxY - 2:
2084-
self.selection = int(self.number_of_items / 2)
2085-
else:
2086-
self.selection = self.startPos + int((self.bodyMaxY - 3) / 2)
2087-
self.refreshBody()
2088-
return
2078+
elif char == ord('M') and self.ws.operation_mode in \
2079+
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2080+
self.jumpnr = ''
2081+
self._random_requested = False
2082+
if self.number_of_items > 0:
2083+
if self.number_of_items < self.bodyMaxY - 2:
2084+
self.selection = int(self.number_of_items / 2)
2085+
else:
2086+
self.selection = self.startPos + int((self.bodyMaxY - 3) / 2)
2087+
self.refreshBody()
2088+
return
20892089

2090-
elif char == ord('L'):
2091-
if self.ws.operation_mode in \
2092-
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2093-
self.jumpnr = ''
2094-
self._random_requested = False
2095-
if self.number_of_items > 0:
2096-
if self.number_of_items < self.bodyMaxY - 2:
2097-
self.setStation(-1)
2098-
else:
2099-
self.selection = self.startPos + self.bodyMaxY - 3
2100-
self.refreshBody()
2101-
return
2090+
elif char == ord('L') and self.ws.operation_mode in \
2091+
(self.ws.NORMAL_MODE, self.ws.PLAYLIST_MODE):
2092+
self.jumpnr = ''
2093+
self._random_requested = False
2094+
if self.number_of_items > 0:
2095+
if self.number_of_items < self.bodyMaxY - 2:
2096+
self.setStation(-1)
2097+
else:
2098+
self.selection = self.startPos + self.bodyMaxY - 3
2099+
self.refreshBody()
2100+
return
21022101

21032102
elif char in (ord('t'), ) and \
21042103
self.ws.operation_mode not in (self.ws.EDIT_STATION_MODE,

0 commit comments

Comments
 (0)