Skip to content

Commit

Permalink
- version 0.8.9.20 (0.9-beta-17)
Browse files Browse the repository at this point in the history
- going back to history will ask to save a modified playlist
- fixing #157 (python2 only)
- other minor changes
  • Loading branch information
s-n-g committed May 22, 2022
1 parent f7ccb4d commit 80ac32d
Show file tree
Hide file tree
Showing 11 changed files with 188 additions and 183 deletions.
8 changes: 7 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
2022-05-22 s-n-g
* 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

2022-05-19 s-n-g
* version 0.8.9.19 (0.9-beta16)
* fixing main window galobal shortcuts
* fixing main window galobal shortcuts ( #156 )
* fixing RadioBrowser Search Window global shortcuts

2022-05-18 s-n-g
Expand Down
8 changes: 7 additions & 1 deletion README.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,15 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
<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>
<pre style="height: 200px;">

2022-05-22 s-n-g
* 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

2022-05-19 s-n-g
* version 0.8.9.19 (0.9-beta16)
* fixing main window galobal shortcuts
* fixing main window galobal shortcuts ( #156 )
* fixing RadioBrowser Search Window global shortcuts

2022-05-18 s-n-g
Expand Down
2 changes: 1 addition & 1 deletion pyradio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" pyradio -- Console radio player. "

version_info = (0, 8, 9, 19)
version_info = (0, 8, 9, 20)

# Set it to True if new stations have been
# added to the package's stations.csv
Expand Down
24 changes: 12 additions & 12 deletions pyradio/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ def set_global_functions(self, global_functions):
self._global_functions = {}
if global_functions is not None:
self._global_functions = dict(global_functions)
if 't' in self._global_functions.keys():
del self._global_functions['t']
if ord('t') in self._global_functions.keys():
del self._global_functions[ord('t')]
# if 'T' in self._global_functions.keys():
# del self._global_functions['T']

Expand Down Expand Up @@ -1712,8 +1712,8 @@ def __init__(
self._global_functions = {}
if global_functions is not None:
self._global_functions = global_functions.copy()
if 't' in self._global_functions.keys():
del self._global_functions['t']
if ord('t') in self._global_functions.keys():
del self._global_functions[ord('t')]

@property
def urls(self):
Expand Down Expand Up @@ -2138,8 +2138,8 @@ def keypress(self, char):
logger.error('---=== Server Selection is None ===---')
self._server_selection_window = None

if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()
return 1
if char in (
curses.KEY_EXIT, 27, ord('q')
Expand Down Expand Up @@ -2312,8 +2312,8 @@ def __init__(self,

if global_functions is not None:
self._global_functions = dict(global_functions)
if 't' in self._global_functions.keys():
del self._global_functions['t']
if ord('t') in self._global_functions.keys():
del self._global_functions[ord('t')]

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

if show_random:
self.items.reverse()
Expand Down Expand Up @@ -4073,8 +4073,8 @@ def keypress(self, char):
if self._too_small:
return 1

if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()
return 1
elif char in (
curses.KEY_EXIT, ord('q'), 27,
Expand Down
32 changes: 16 additions & 16 deletions pyradio/config_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def set_global_functions(global_functions):
ret = {}
if global_functions is not None:
ret = dict(global_functions)
if 't' in ret.keys():
del ret['t']
if ord('t') in ret.keys():
del ret[ord('t')]
return ret

class PyRadioConfigWindow(object):
Expand Down Expand Up @@ -362,8 +362,8 @@ def keypress(self, char):
if self.too_small:
return 1, []
val = list(self._config_options.items())[self.selection]
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()
elif val[0] == 'radiobrowser':
if char in (curses.KEY_RIGHT, ord('l'),
ord(' '), curses.KEY_ENTER, ord('\n')):
Expand Down Expand Up @@ -867,8 +867,8 @@ def keypress(self, char):
''' cancel '''
self.edit_string = ''
ret = 0
elif chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
elif char in self._global_functions.keys():
self._global_functions[char]()
return 1

if ret == 1:
Expand Down Expand Up @@ -1186,8 +1186,8 @@ def keypress(self, char):
5 - add parameter
6 - line editor help
'''
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()
return -1
elif char in (
curses.KEY_ENTER, ord('\n'),
Expand Down Expand Up @@ -1487,8 +1487,8 @@ def keypress(self, char):
'''
if self.editing == 0:
''' focus on players '''
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()
elif char in (9, ):
if self._players[self.selection][1]:
self._switch_column()
Expand Down Expand Up @@ -1893,8 +1893,8 @@ def _col_row_to_selection(self, a_column, a_row):
def keypress(self, char):
''' Encoding key press
'''
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()

elif char in (ord('c'), ):
self.encoding = self._config_encoding
Expand Down Expand Up @@ -2292,8 +2292,8 @@ def keypress(self, char):
0, station path - selected station path (for paste window)
1, '' - Cancel
'''
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()

elif self._select_playlist_error == -1 or \
self._select_playlist_error == 0:
Expand Down Expand Up @@ -2532,8 +2532,8 @@ def keypress(self, char):
self.setStation(self._orig_playlist)
return -1, ''

elif chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
elif char in self._global_functions.keys():
self._global_functions[char]()
return -1, ''

return PyRadioSelectPlaylist.keypress(self, char)
Expand Down
32 changes: 24 additions & 8 deletions pyradio/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def show(self, item=None):
self._win.addstr(17 + step, 5, '─' * (self.maxX - 10), curses.color_pair(3))
except:
self._win.addstr(17 + step, 3, '─'.encode('utf-8') * (self.maxX - 10), curses.color_pair(3))
self._win.addstr(17 + step, int((self.maxX - 33) / 2), ' Player Keys (Not in Line Editor) ', curses.color_pair(4))
self._win.addstr(17 + step, int((self.maxX - 42) / 2), ' Global Functions (with \ in Line Editor) ', curses.color_pair(4))

self._win.addstr(18 + step, 5, '-', curses.color_pair(4))
self._win.addstr('/', curses.color_pair(5))
Expand All @@ -400,6 +400,14 @@ def show(self, item=None):
self._win.addstr('ute player / Save ', curses.color_pair(5))
self._win.addstr('v', curses.color_pair(4))
self._win.addstr('olume (not in vlc).', curses.color_pair(5))
if step + 21 < self.maxY:
self._win.addstr(20 + step, 5, 'W', curses.color_pair(4))
self._win.addstr(' / ', curses.color_pair(5))
self._win.addstr('w', curses.color_pair(4))
self._win.addstr(20 + step, 23, 'Toggle titles log / like a station', curses.color_pair(5))
if step + 22 < self.maxY:
self._win.addstr(21 + step, 5, 'T', curses.color_pair(4))
self._win.addstr(21 + step, 23, 'Toggle transparency', curses.color_pair(5))

if item:
self._set_item(item)
Expand Down Expand Up @@ -629,8 +637,8 @@ def keypress(self, char):
self.new_station = None
self._reset_editors_modes()
ret = -1
elif chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
elif char in self._global_functions.keys():
self._global_functions[char]()

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

self._win.addstr(19 + adjust_line_Y, 5, '-', curses.color_pair(4))
self._win.addstr('/', curses.color_pair(5))
Expand All @@ -975,6 +983,14 @@ def show(self):
self._win.addstr('ute player / Save ', curses.color_pair(5))
self._win.addstr('v', curses.color_pair(4))
self._win.addstr('olume (not in vlc).', curses.color_pair(5))
if adjust_line_Y + 22 < self.maxY:
self._win.addstr(21 + adjust_line_Y, 5, 'W', curses.color_pair(4))
self._win.addstr(' / ', curses.color_pair(5))
self._win.addstr('w', curses.color_pair(4))
self._win.addstr(21 + adjust_line_Y, 23, 'Toggle titles log / like a station', curses.color_pair(5))
if adjust_line_Y + 23 < self.maxY:
self._win.addstr(22 + adjust_line_Y, 5, 'T', curses.color_pair(4))
self._win.addstr(22 + adjust_line_Y, 23, 'Toggle transparency', curses.color_pair(5))

self._win.refresh()
self._update_focus()
Expand Down Expand Up @@ -1150,8 +1166,8 @@ def keypress(self, char):
# cancel
self._widgets[0].string = ''
ret = -1
elif chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
elif char in self._global_functions.keys():
self._global_functions[char]()
#self._show_title()
#self.show()
return self._get_result(ret)
Expand Down Expand Up @@ -1236,8 +1252,8 @@ def keypress(self, char):
0: go on
1: Ok
"""
if chr(char) in self._global_functions.keys():
self._global_functions[chr(char)]()
if char in self._global_functions.keys():
self._global_functions[char]()

elif char in (curses.KEY_ENTER, ord('\n'), ord('\r'), ord('s')):
return 1
Expand Down
2 changes: 1 addition & 1 deletion pyradio/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def update_or_uninstall_on_windows(self, mode='update', from_pyradio=False, firs
b.write(')\n')

b.write('devel\\build_install_pyradio.bat -u\n')
b.write('PAUSE\n')
# b.write('PAUSE\n')
b.write('GOTO endofscript\n')
b.write('ECHO.\n\n')
b.write(':downloaderror\n')
Expand Down
Loading

0 comments on commit 80ac32d

Please sign in to comment.