Skip to content

Commit d0a1a61

Browse files
committed
- Version 0.8.9.32 (0.9-beta29)
- Making it possible to disable the no themes start up notification
1 parent 054623b commit d0a1a61

10 files changed

+304
-156
lines changed

Changelog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2022-12-09 s-n-g
2+
* version 0.8.9.32 (0.9-beta29)
3+
* Making it possible to disable the no themes start
4+
up notification
5+
* Fixing Config Window scrolling
6+
* Fixing ping for python2 and the BSDs (again)
7+
* Desktop Notification will stop when player is muted
8+
* RadioBrowser config will be centered on screen
9+
* RadioBrowser config will return to Config Window
10+
* Started working on remote controlling PyRadio
11+
112
2022-11-25 s-n-g
213
* version 0.8.9.31 (0.9-beta28)
314
* fixing icon installation and discovery

README.html

+13-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
190190
<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></span></h2>
191191
<pre style="height: 200px;">
192192

193+
2022-12-09 s-n-g
194+
* version 0.8.9.32 (0.9-beta29)
195+
* Making it possible to disable the no themes start
196+
up notification
197+
* Fixing Config Window scrolling
198+
* Fixing ping for python2 and the BSDs (again)
199+
* Desktop Notification will stop when player is muted
200+
* RadioBrowser config will be centered on screen
201+
* RadioBrowser config will return to Config Window
202+
* Started working on remote controlling PyRadio
203+
193204
2022-11-25 s-n-g
194205
* version 0.8.9.31 (0.9-beta28)
195206
* fixing icon installation and discovery
@@ -1252,7 +1263,7 @@ <h4 id="using-the-command-line">Using the command line</h4>
12521263
<pre>pyradio -ep &quot;mpv:profile:second_sound_card&quot;</pre>
12531264
<h4 id="using-the-configuration-window">Using the Configuration Window</h4>
12541265
<p>When the user uses the configuration window (shown in the following image), he is presented with an interface which will permit him to select the player to use with <strong>PyRadio</strong> and edit its extra parameters.</p>
1255-
<p><a href="https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg" target="_blank"><img src="https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg" alt="PyRadio Player Selectio Window" /></a></p>
1266+
<p><a href="https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg" target="_blank"><img src="https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg" alt="PyRadio Player Selection Window" /></a></p>
12561267

12571268
<p>Each of the supported players can have up to 11 sets of extra parameters (the first one is the default).</p>
12581269
<p>The user can add (“<strong>a</strong>”) a new parameter, edit (“<strong>e</strong>”) an existing set and delete (“<strong>x</strong>” or “<strong>DEL</strong>”) one.</p>
@@ -1626,7 +1637,7 @@ <h3 id="specifying-the-terminal-to-use">Specifying the terminal to use</h3>
16261637
<p>This command will set the terminal in the Desktop file, so that:</p>
16271638
<pre>Exec=kitty -e pyradio</pre>
16281639
<p>To have <strong>PyRadio</strong> try to find a suitable terminal, execute:</p>
1629-
<pre>pyraio --terminal auto</pre>
1640+
<pre>pyradio --terminal auto</pre>
16301641
<p>To restore the original functionality (specifying no terminal):</p>
16311642
<pre>pyradio --terminal none</pre>
16321643
<h4 id="specifying-pyradio-parameters">Specifying PyRadio parameters</h4>

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ Example:
627627

628628
When the user uses the configuration window (shown in the following image), he is presented with an interface which will permit him to select the player to use with **PyRadio** and edit its extra parameters.
629629

630-
![PyRadio Player Selectio Window](https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg)
630+
![PyRadio Player Selection Window](https://members.hellug.gr/sng/pyradio/pyradio-player-selection.jpg)
631631

632632
Each of the supported players can have up to 11 sets of extra parameters (the first one is the default).
633633

@@ -1153,7 +1153,7 @@ This command will set the terminal in the Desktop file, so that:
11531153

11541154
To have **PyRadio** try to find a suitable terminal, execute:
11551155

1156-
pyraio --terminal auto
1156+
pyradio --terminal auto
11571157

11581158
To restore the original functionality (specifying no terminal):
11591159

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

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

pyradio/browser.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .player import info_dict_to_list
2020
from .cjkwrap import cjklen, PY3
2121
from .countries import countries
22-
from .simple_curses_widgets import SimpleCursesLineEdit, SimpleCursesHorizontalPushButtons, SimpleCursesWidgetColumns, SimpleCursesCheckBox, SimpleCursesCounter, SimpleCursesBoolean, DisabledWidget, SimpleCursesString
22+
from .simple_curses_widgets import SimpleCursesLineEdit, SimpleCursesHorizontalPushButtons, SimpleCursesWidgetColumns, SimpleCursesCheckBox, SimpleCursesCounter, SimpleCursesBoolean, DisabledWidget, SimpleCursesString, SimpleCursesMenuEntries
2323
from .ping import ping
2424

2525
import locale
@@ -1279,7 +1279,6 @@ def select_servers(self, with_config=False, return_function=None, init=False, gl
12791279
self._server_selection_window.move(12, self._left + 7)
12801280
else:
12811281
self._server_selection_window.move(12, self._config_win._left + 7)
1282-
logger.error('\n\nSetting Y\n\n')
12831282
self.keyboard_handler = self._server_selection_window
12841283
self.server_window_from_config = with_config
12851284
self._server_selection_window.show()
@@ -2052,6 +2051,17 @@ def show(self, parent, init=False):
20522051
self._widgets[-1].token = 'server'
20532052
self._widgets[-1].id = 4
20542053
self._widgets[-1].enabled = self.enable_servers
2054+
2055+
# self._widgets.append(
2056+
# SimpleCursesMenuEntries(
2057+
# )
2058+
# )
2059+
# self._widgets[-1].token = 'terms'
2060+
# self._widgets[-1].id = 5
2061+
# self._widgets[-1].enabled = True
2062+
2063+
2064+
20552065
self._fix_focus(show=False)
20562066
else:
20572067
for i in range(0, len(self._widgets)):
@@ -2081,6 +2091,9 @@ def show(self, parent, init=False):
20812091
self._fix_ping_enable()
20822092
self._win.refresh()
20832093

2094+
# for n in self._widgets:
2095+
# logger.error(n)
2096+
20842097
self._showed = True
20852098
# self._print_params()
20862099

pyradio/config.py

+31-2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class PyRadioStations(object):
114114

115115
normal_stations_history = None
116116

117+
show_no_themes_message = True
118+
119+
server_ip = '127.0.0.1'
120+
server_port = 9998
121+
117122
def __init__(self, stationFile=''):
118123
if platform.startswith('win'):
119124
self._open_string_id = 1
@@ -505,6 +510,13 @@ def integrate_playlists(self):
505510
if logger.isEnabledFor(logging.DEBUG):
506511
logger.debug('Added: {0} - {1}'.format(self.added_stations, a_pkg_station))
507512

513+
def read_playlist_for_server(self, stationFile):
514+
out = []
515+
with open(self._construct_playlist_path(stationFile), 'r') as cfgfile:
516+
for row in csv.reader(filter(lambda row: row[0]!='#', cfgfile), skipinitialspace=True):
517+
out.append(row[0])
518+
return out
519+
508520
def read_playlist_file(
509521
self,
510522
stationFile='',
@@ -1582,6 +1594,9 @@ def is_default_file(self, a_theme_name):
15821594
return True
15831595
return False
15841596

1597+
def _construct_playlist_path(self, a_playlist):
1598+
return path.join(self.stations_dir, a_playlist + '.csv')
1599+
15851600
def _read_notification_command(self):
15861601
self._notification_command = []
15871602
if platform == 'win32':
@@ -1843,7 +1858,13 @@ def read_config(self):
18431858
return -2
18441859
if sp[1] == '':
18451860
return -2
1846-
if sp[0] == 'player':
1861+
if sp[0] == 'show_no_themes_message':
1862+
self.show_no_themes_message = True
1863+
st = sp[1].strip()
1864+
if st.lower() == 'false':
1865+
self.show_no_themes_message = False
1866+
1867+
elif sp[0] == 'player':
18471868
self.opts['player'][1] = sp[1].lower().strip()
18481869
# if sys.platform.startswith('win'):
18491870
# self.opts['player'][1] = self.opts['player'][1].replace('mpv,', '')
@@ -2243,6 +2264,13 @@ def save_config(self, from_command_line=False):
22432264
# Default value: False
22442265
auto_save_playlist = {14}
22452266
2267+
# When PyRadio determines that a restricted
2268+
# terminal is used, it will display a message
2269+
# every time it is lounched. To disable this
2270+
# message, change the value to False.
2271+
# Default value: True
2272+
show_no_themes_message = {15}
2273+
22462274
'''
22472275
copyfile(self.config_file, self.config_file + '.restore')
22482276
if self.opts['default_station'][1] is None:
@@ -2274,7 +2302,8 @@ def save_config(self, from_command_line=False):
22742302
calcf,
22752303
self.opts['confirm_station_deletion'][1],
22762304
self.opts['confirm_playlist_reload'][1],
2277-
self.opts['auto_save_playlist'][1]))
2305+
self.opts['auto_save_playlist'][1],
2306+
self.show_no_themes_message))
22782307

22792308
''' write extra player parameters to file '''
22802309
first_param = True

0 commit comments

Comments
 (0)