Skip to content

Commit 9ea7a80

Browse files
committed
- removing HTML from server response for stations list text request
- fixing #249 - Cannot type # in radio station name - working on scheduler (n/a)
1 parent 127fa1e commit 9ea7a80

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

pyradio/config_window.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3179,8 +3179,16 @@ class PyRadioSelectStation(PyRadioSelectPlaylist):
31793179

31803180
_default_playlist = ''
31813181

3182-
def __init__(self, parent, config_path, registers_dir, default_playlist, default_station,
3183-
global_functions=None, is_from_schedule=False):
3182+
def __init__(
3183+
self,
3184+
parent,
3185+
config_path,
3186+
registers_dir,
3187+
default_playlist,
3188+
default_station,
3189+
global_functions=None,
3190+
is_from_schedule=False
3191+
):
31843192
self._default_playlist = default_playlist
31853193
self._orig_default_playlist = default_playlist
31863194
if logger.isEnabledFor(logging.INFO):

pyradio/messages_system.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class PyRadioMessagesSystem(object):
7373
'M_SCHEDULE_INFO',
7474
'M_SCHEDULE_ERROR',
7575
'M_REC_IS_ON_NO_DIR_HEADLESS',
76+
'M_SCHEDULE_INFO',
7677
)
7778

7879
_two_arg_list = (

pyradio/radio.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ def __init__(self, pyradio_config,
732732
curses.KEY_PREVIOUS: self._play_previous_station,
733733
curses.ascii.SO: self._play_next_station,
734734
curses.KEY_NEXT: self._play_next_station,
735+
ord('#'): self._resize_with_number_sign,
735736
# ord('d'): self._html_song_title,
736737
# ord('b'): self._show_schedule_editor,
737738
}
@@ -6012,20 +6013,6 @@ def keypress(self, char):
60126013
callback_function=self.refreshBody)
60136014
return
60146015

6015-
# if char == ord('1'):
6016-
# logger.error('self._cnf.recording_dir = "/home/spiros/pyradio-mkvs"')
6017-
# self._cnf.recording_dir = '/home/spiros/home-at-homepc/00000'
6018-
# return
6019-
6020-
if char in (ord('#'), curses.KEY_RESIZE):
6021-
self._i_am_resizing = True
6022-
self._normal_mode_resize()
6023-
if not self._limited_width_mode:
6024-
if not self._limited_height_mode:
6025-
self._do_display_notify()
6026-
self._i_am_resizing = False
6027-
return
6028-
60296016
if self.ws.operation_mode == self.ws.MESSAGING_MODE:
60306017
ret = self._messaging_win.keypress(char)
60316018
if ret:
@@ -6780,10 +6767,11 @@ def keypress(self, char):
67806767
self.ws.operation_mode = self.ws.SCHEDULE_STATION_SELECT_MODE
67816768
if self._schedule_station_select_win is None:
67826769
self._schedule_station_select_win = PyRadioSelectStation(
6783-
self.bodyWin,
6784-
self._cnf.stations_dir,
6785-
self._simple_schedule.playlist,
6786-
self._simple_schedule.station,
6770+
parent=self.bodyWin,
6771+
config_path=self._cnf.stations_dir,
6772+
registers_dir=self._cnf.registers_dir,
6773+
default_playlist=self._simple_schedule.playlist,
6774+
default_station=self._simple_schedule.station,
67876775
is_from_schedule=True,
67886776
global_functions=self._global_functions
67896777
)
@@ -9094,6 +9082,15 @@ def keypress(self, char):
90949082
# else:
90959083
# self._update_status_bar_right(status_suffix='')
90969084

9085+
def _resize_with_number_sign(self):
9086+
logger.error('\n\nresize with number sign\n\n')
9087+
self._i_am_resizing = True
9088+
self._normal_mode_resize()
9089+
if not self._limited_width_mode:
9090+
if not self._limited_height_mode:
9091+
self._do_display_notify()
9092+
self._i_am_resizing = False
9093+
90979094
def _jump_and_play_selection(self, jumpnr=None):
90989095
self._jump_to_jumpnr('', jumpnr)
90999096
self.playSelection()

pyradio/schedule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ def get_repeating_dates(self, in_date, count=-1):
232232
if in_date[-4] == 'day':
233233
ll = list(rrule(DAILY, count=count, dtstart=start_date))
234234
elif in_date[-4] == 'week':
235-
ll = list(rrule(WEEKLY, dtstart=in_date[0], count=count))
235+
ll = list(rrule(WEEKLY, dtstart=in_date[1], count=count))
236236
elif in_date[-4] == 'month':
237-
ll = list(rrule(MONTHLY, dtstart=in_date[0], count=count))
237+
ll = list(rrule(MONTHLY, dtstart=in_date[1], count=count))
238238
elif in_date[-4] in days.keys():
239239
ll = list(rrule(WEEKLY, count=count, wkst=SU, byweekday=(days[in_date[-4]],), dtstart=start_date))
240240

pyradio/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ def _handle_client_connection(self, address, request):
17751775
)
17761776
else:
17771777
self._send_text(
1778-
self._list_stations(playlist_name, out)
1778+
self._list_stations(playlist_name, out).replace(r'<b>', '').replace(r'</b>', '')
17791779
)
17801780
else:
17811781
if self._is_html:
@@ -1979,7 +1979,7 @@ def _list_stations(
19791979
else:
19801980
out.append(n[0])
19811981
else:
1982-
out.append(n[0])
1982+
out.append(n[0])
19831983
p_name = basename(self.playlist_in_editor()[:-4])
19841984
else:
19851985
out = stations

0 commit comments

Comments
 (0)