Skip to content

Commit 80ac32d

Browse files
committed
- version 0.8.9.20 (0.9-beta-17)
- going back to history will ask to save a modified playlist - fixing #157 (python2 only) - other minor changes
1 parent f7ccb4d commit 80ac32d

11 files changed

+188
-183
lines changed

Changelog

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
2022-05-22 s-n-g
2+
* version 0.8.9.20 (0.9-beta-17)
3+
* going back to history will ask to save a modified playlist
4+
* fixing #157 (python2 only)
5+
* other minor changes
6+
17
2022-05-19 s-n-g
28
* version 0.8.9.19 (0.9-beta16)
3-
* fixing main window galobal shortcuts
9+
* fixing main window galobal shortcuts ( #156 )
410
* fixing RadioBrowser Search Window global shortcuts
511

612
2022-05-18 s-n-g

README.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,15 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
153153
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
154154
<pre style="height: 200px;">
155155

156+
2022-05-22 s-n-g
157+
* version 0.8.9.20 (0.9-beta-17)
158+
* going back to history will ask to save a modified playlist
159+
* fixing #157 (python2 only)
160+
* other minor changes
161+
156162
2022-05-19 s-n-g
157163
* version 0.8.9.19 (0.9-beta16)
158-
* fixing main window galobal shortcuts
164+
* fixing main window galobal shortcuts ( #156 )
159165
* fixing RadioBrowser Search Window global shortcuts
160166

161167
2022-05-18 s-n-g

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, 9, 19)
3+
version_info = (0, 8, 9, 20)
44

55
# Set it to True if new stations have been
66
# added to the package's stations.csv

pyradio/browser.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ def set_global_functions(self, global_functions):
399399
self._global_functions = {}
400400
if global_functions is not None:
401401
self._global_functions = dict(global_functions)
402-
if 't' in self._global_functions.keys():
403-
del self._global_functions['t']
402+
if ord('t') in self._global_functions.keys():
403+
del self._global_functions[ord('t')]
404404
# if 'T' in self._global_functions.keys():
405405
# del self._global_functions['T']
406406

@@ -1712,8 +1712,8 @@ def __init__(
17121712
self._global_functions = {}
17131713
if global_functions is not None:
17141714
self._global_functions = global_functions.copy()
1715-
if 't' in self._global_functions.keys():
1716-
del self._global_functions['t']
1715+
if ord('t') in self._global_functions.keys():
1716+
del self._global_functions[ord('t')]
17171717

17181718
@property
17191719
def urls(self):
@@ -2138,8 +2138,8 @@ def keypress(self, char):
21382138
logger.error('---=== Server Selection is None ===---')
21392139
self._server_selection_window = None
21402140

2141-
if chr(char) in self._global_functions.keys():
2142-
self._global_functions[chr(char)]()
2141+
if char in self._global_functions.keys():
2142+
self._global_functions[char]()
21432143
return 1
21442144
if char in (
21452145
curses.KEY_EXIT, 27, ord('q')
@@ -2312,8 +2312,8 @@ def __init__(self,
23122312

23132313
if global_functions is not None:
23142314
self._global_functions = dict(global_functions)
2315-
if 't' in self._global_functions.keys():
2316-
del self._global_functions['t']
2315+
if ord('t') in self._global_functions.keys():
2316+
del self._global_functions[ord('t')]
23172317

23182318
def __del__(self):
23192319
for a_widget in self._widgets:
@@ -4012,8 +4012,8 @@ def __init__(self, parent, servers, current_server, show_random=False, global_fu
40124012
# if global_functions is not None:
40134013
# logger.error('\n\n{}\n\n'.format(global_functions))
40144014
# self._global_functions = deepcopy(global_functions)
4015-
# if 't' in self._global_functions.keys():
4016-
# del self._global_functions['t']
4015+
# if ord('t') in self._global_functions.keys():
4016+
# del self._global_functions[ord('t')]
40174017

40184018
if show_random:
40194019
self.items.reverse()
@@ -4073,8 +4073,8 @@ def keypress(self, char):
40734073
if self._too_small:
40744074
return 1
40754075

4076-
if chr(char) in self._global_functions.keys():
4077-
self._global_functions[chr(char)]()
4076+
if char in self._global_functions.keys():
4077+
self._global_functions[char]()
40784078
return 1
40794079
elif char in (
40804080
curses.KEY_EXIT, ord('q'), 27,

pyradio/config_window.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def set_global_functions(global_functions):
2525
ret = {}
2626
if global_functions is not None:
2727
ret = dict(global_functions)
28-
if 't' in ret.keys():
29-
del ret['t']
28+
if ord('t') in ret.keys():
29+
del ret[ord('t')]
3030
return ret
3131

3232
class PyRadioConfigWindow(object):
@@ -362,8 +362,8 @@ def keypress(self, char):
362362
if self.too_small:
363363
return 1, []
364364
val = list(self._config_options.items())[self.selection]
365-
if chr(char) in self._global_functions.keys():
366-
self._global_functions[chr(char)]()
365+
if char in self._global_functions.keys():
366+
self._global_functions[char]()
367367
elif val[0] == 'radiobrowser':
368368
if char in (curses.KEY_RIGHT, ord('l'),
369369
ord(' '), curses.KEY_ENTER, ord('\n')):
@@ -867,8 +867,8 @@ def keypress(self, char):
867867
''' cancel '''
868868
self.edit_string = ''
869869
ret = 0
870-
elif chr(char) in self._global_functions.keys():
871-
self._global_functions[chr(char)]()
870+
elif char in self._global_functions.keys():
871+
self._global_functions[char]()
872872
return 1
873873

874874
if ret == 1:
@@ -1186,8 +1186,8 @@ def keypress(self, char):
11861186
5 - add parameter
11871187
6 - line editor help
11881188
'''
1189-
if chr(char) in self._global_functions.keys():
1190-
self._global_functions[chr(char)]()
1189+
if char in self._global_functions.keys():
1190+
self._global_functions[char]()
11911191
return -1
11921192
elif char in (
11931193
curses.KEY_ENTER, ord('\n'),
@@ -1487,8 +1487,8 @@ def keypress(self, char):
14871487
'''
14881488
if self.editing == 0:
14891489
''' focus on players '''
1490-
if chr(char) in self._global_functions.keys():
1491-
self._global_functions[chr(char)]()
1490+
if char in self._global_functions.keys():
1491+
self._global_functions[char]()
14921492
elif char in (9, ):
14931493
if self._players[self.selection][1]:
14941494
self._switch_column()
@@ -1893,8 +1893,8 @@ def _col_row_to_selection(self, a_column, a_row):
18931893
def keypress(self, char):
18941894
''' Encoding key press
18951895
'''
1896-
if chr(char) in self._global_functions.keys():
1897-
self._global_functions[chr(char)]()
1896+
if char in self._global_functions.keys():
1897+
self._global_functions[char]()
18981898

18991899
elif char in (ord('c'), ):
19001900
self.encoding = self._config_encoding
@@ -2292,8 +2292,8 @@ def keypress(self, char):
22922292
0, station path - selected station path (for paste window)
22932293
1, '' - Cancel
22942294
'''
2295-
if chr(char) in self._global_functions.keys():
2296-
self._global_functions[chr(char)]()
2295+
if char in self._global_functions.keys():
2296+
self._global_functions[char]()
22972297

22982298
elif self._select_playlist_error == -1 or \
22992299
self._select_playlist_error == 0:
@@ -2532,8 +2532,8 @@ def keypress(self, char):
25322532
self.setStation(self._orig_playlist)
25332533
return -1, ''
25342534

2535-
elif chr(char) in self._global_functions.keys():
2536-
self._global_functions[chr(char)]()
2535+
elif char in self._global_functions.keys():
2536+
self._global_functions[char]()
25372537
return -1, ''
25382538

25392539
return PyRadioSelectPlaylist.keypress(self, char)

pyradio/edit.py

+24-8
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def show(self, item=None):
383383
self._win.addstr(17 + step, 5, '─' * (self.maxX - 10), curses.color_pair(3))
384384
except:
385385
self._win.addstr(17 + step, 3, '─'.encode('utf-8') * (self.maxX - 10), curses.color_pair(3))
386-
self._win.addstr(17 + step, int((self.maxX - 33) / 2), ' Player Keys (Not in Line Editor) ', curses.color_pair(4))
386+
self._win.addstr(17 + step, int((self.maxX - 42) / 2), ' Global Functions (with \ in Line Editor) ', curses.color_pair(4))
387387

388388
self._win.addstr(18 + step, 5, '-', curses.color_pair(4))
389389
self._win.addstr('/', curses.color_pair(5))
@@ -400,6 +400,14 @@ def show(self, item=None):
400400
self._win.addstr('ute player / Save ', curses.color_pair(5))
401401
self._win.addstr('v', curses.color_pair(4))
402402
self._win.addstr('olume (not in vlc).', curses.color_pair(5))
403+
if step + 21 < self.maxY:
404+
self._win.addstr(20 + step, 5, 'W', curses.color_pair(4))
405+
self._win.addstr(' / ', curses.color_pair(5))
406+
self._win.addstr('w', curses.color_pair(4))
407+
self._win.addstr(20 + step, 23, 'Toggle titles log / like a station', curses.color_pair(5))
408+
if step + 22 < self.maxY:
409+
self._win.addstr(21 + step, 5, 'T', curses.color_pair(4))
410+
self._win.addstr(21 + step, 23, 'Toggle transparency', curses.color_pair(5))
403411

404412
if item:
405413
self._set_item(item)
@@ -629,8 +637,8 @@ def keypress(self, char):
629637
self.new_station = None
630638
self._reset_editors_modes()
631639
ret = -1
632-
elif chr(char) in self._global_functions.keys():
633-
self._global_functions[chr(char)]()
640+
elif char in self._global_functions.keys():
641+
self._global_functions[char]()
634642

635643
if self._focus > 1:
636644
self._reset_editors_modes()
@@ -958,7 +966,7 @@ def show(self):
958966
self._win.addstr(18 + adjust_line_Y, 5, '─' * (self.maxX - 10), curses.color_pair(3))
959967
except:
960968
self._win.addstr(18 + adjust_line_Y, 3, '─'.encode('utf-8') * (self.maxX - 10), curses.color_pair(3))
961-
self._win.addstr(18 + adjust_line_Y, int((self.maxX - 33) / 2), ' Player Keys (Not in Line Editor) ', curses.color_pair(4))
969+
self._win.addstr(18 + adjust_line_Y, int((self.maxX - 42) / 2), ' Global Functions (with \ in Line Editor) ', curses.color_pair(4))
962970

963971
self._win.addstr(19 + adjust_line_Y, 5, '-', curses.color_pair(4))
964972
self._win.addstr('/', curses.color_pair(5))
@@ -975,6 +983,14 @@ def show(self):
975983
self._win.addstr('ute player / Save ', curses.color_pair(5))
976984
self._win.addstr('v', curses.color_pair(4))
977985
self._win.addstr('olume (not in vlc).', curses.color_pair(5))
986+
if adjust_line_Y + 22 < self.maxY:
987+
self._win.addstr(21 + adjust_line_Y, 5, 'W', curses.color_pair(4))
988+
self._win.addstr(' / ', curses.color_pair(5))
989+
self._win.addstr('w', curses.color_pair(4))
990+
self._win.addstr(21 + adjust_line_Y, 23, 'Toggle titles log / like a station', curses.color_pair(5))
991+
if adjust_line_Y + 23 < self.maxY:
992+
self._win.addstr(22 + adjust_line_Y, 5, 'T', curses.color_pair(4))
993+
self._win.addstr(22 + adjust_line_Y, 23, 'Toggle transparency', curses.color_pair(5))
978994

979995
self._win.refresh()
980996
self._update_focus()
@@ -1150,8 +1166,8 @@ def keypress(self, char):
11501166
# cancel
11511167
self._widgets[0].string = ''
11521168
ret = -1
1153-
elif chr(char) in self._global_functions.keys():
1154-
self._global_functions[chr(char)]()
1169+
elif char in self._global_functions.keys():
1170+
self._global_functions[char]()
11551171
#self._show_title()
11561172
#self.show()
11571173
return self._get_result(ret)
@@ -1236,8 +1252,8 @@ def keypress(self, char):
12361252
0: go on
12371253
1: Ok
12381254
"""
1239-
if chr(char) in self._global_functions.keys():
1240-
self._global_functions[chr(char)]()
1255+
if char in self._global_functions.keys():
1256+
self._global_functions[char]()
12411257

12421258
elif char in (curses.KEY_ENTER, ord('\n'), ord('\r'), ord('s')):
12431259
return 1

pyradio/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def update_or_uninstall_on_windows(self, mode='update', from_pyradio=False, firs
634634
b.write(')\n')
635635

636636
b.write('devel\\build_install_pyradio.bat -u\n')
637-
b.write('PAUSE\n')
637+
# b.write('PAUSE\n')
638638
b.write('GOTO endofscript\n')
639639
b.write('ECHO.\n\n')
640640
b.write(':downloaderror\n')

0 commit comments

Comments
 (0)