Skip to content

Commit

Permalink
- show correct help page when in online browser
Browse files Browse the repository at this point in the history
- Windows installation will fail if a dependency fails to install
  • Loading branch information
s-n-g committed Oct 14, 2021
1 parent b9db914 commit 3347185
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 13 deletions.
8 changes: 5 additions & 3 deletions Changelog
@@ -1,13 +1,15 @@
2021-10-13 s-n-g
2021-10-14 s-n-g
* adding check for -p parameter (int)
* keep looking for a station after playback failure when random is on
* trying to better VLC start of playback detection
* last opened playlist will restore station selection or resume playback
* mplayer on Windows: do not fail to start a station
after astop/start command
* trying to eliminate crashes when window width gets small
(like in tilling managers)
* show correct help page when in online browser
* mplayer on Windows: do not fail to start a station
after astop/start command
* install.py will always use the requested python version
* Windows installation will fail if a dependency fails to install
* updating docs (adding "Limited display" image")

2021-09-14 s-n-g
Expand Down
8 changes: 5 additions & 3 deletions README.html
Expand Up @@ -142,16 +142,18 @@ <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;">

2021-10-13 s-n-g
2021-10-14 s-n-g
* adding check for -p parameter (int)
* keep looking for a station after playback failure when random is on
* trying to better VLC start of playback detection
* last opened playlist will restore station selection or resume playback
* mplayer on Windows: do not fail to start a station
after astop/start command
* trying to eliminate crashes when window width gets small
(like in tilling managers)
* show correct help page when in online browser
* mplayer on Windows: do not fail to start a station
after astop/start command
* install.py will always use the requested python version
* Windows installation will fail if a dependency fails to install
* updating docs (adding "Limited display" image")

2021-09-14 s-n-g
Expand Down
41 changes: 41 additions & 0 deletions devel/build_install_pyradio.bat
Expand Up @@ -32,9 +32,25 @@ IF "%1"=="" (
CLS
ECHO Installing / Updating python modules
pip install windows-curses --upgrade 1>NUL 2>NUL
if ERRORLEVEL 1 (
set ERRPKG=windows-curses
GOTO piperror
)
pip install pywin32 --upgrade 1>NUL 2>NUL
if ERRORLEVEL 1 (
set ERRPKG=pywin32
GOTO piperror
)
pip install requests --upgrade 1>NUL 2>NUL
if ERRORLEVEL 1 (
set ERRPKG=requests
GOTO piperror
)
pip install dnspython --upgrade 1>NUL 2>NUL
if ERRORLEVEL 1 (
set ERRPKG=dnspython
GOTO piperror
)
)

IF '%1'=='ELEV' ( GOTO START ) ELSE ( ECHO Running elevated in a different window)
Expand Down Expand Up @@ -116,6 +132,7 @@ ECHO.
ECHO.
ECHO ###############################################
ECHO # The installation has failed! #
ECHO # #
ECHO # This is probably because PyRadio is already #
ECHO # running, so files canNOT be overwritten. #
ECHO # Please terminate PyRadio and try again. #
Expand All @@ -138,6 +155,30 @@ IF NOT EXIST %DESKTOP%\PyRadio.lnk GOTO linkcopy
ECHO === Dekstop Shortcut already exists
GOTO toend

:piperror
CLS
ECHO The installation has failed
ECHO.
ECHO One of PyRadio's dependencies has not been found
ECHO( package: !ERRPKG!
ECHO.
ECHO This means that packagers have not yet produced a
ECHO package for this version of python (it was
ECHO probably released recently).
ECHO.
ECHO What can you do?
ECHO 1. Wait for the package to be updated (which
ECHO means you will not be able to use PyRadio
ECHO until then), or
ECHO 2. Uninstall python and then go to
ECHO https://www.python.org/downloads/
ECHO and download and install the second to
ECHO last version.
ECHO .
ECHO Then try installing PyRadio again
ECHO.
ECHO.
GOTO endnopause

:linkcopy
ECHO *** Installing Dekstop Shortcut
Expand Down
9 changes: 9 additions & 0 deletions pyradio/install.py
Expand Up @@ -204,6 +204,15 @@ def get_github_tag():
''' get the name of the latest PyRadio tag on GitHub '''
return get_github_long_description(only_tag_name=True)

def get_next_release():
r = get_github_long_description()
print('Descriptyion: {}'.format(r))

sp = r[1].split('-')
print('sp = {}'.format(sp))
x = int(sp[1]) + 1
return sp[0] + '-r{}'.format(x)

def WindowExists(title):
try:
win32ui.FindWindow(None, title)
Expand Down
23 changes: 16 additions & 7 deletions pyradio/radio.py
Expand Up @@ -1835,7 +1835,7 @@ def _show_radio_browser_search_help(self):
mode_to_set=self.ws.RADIO_BROWSER_SEARCH_HELP_MODE,
caption=' RadioBrowser Search Help ')

def _show_main_help(self):
def _show_main_help(self, from_keyboard=False):
txt = '''Up|,|j|,|PgUp|,
Down|,|k|,|PgDown |Change station selection.
<n>g| / |<n>G |Jump to first /last or n-th station.
Expand All @@ -1860,8 +1860,10 @@ def _show_main_help(self):
self._help_metrics[self.ws.MAIN_HELP_MODE_PAGE_2] = self._help_metrics[self.ws.MAIN_HELP_MODE]
self._help_metrics[self.ws.MAIN_HELP_MODE_PAGE_3] = self._help_metrics[self.ws.MAIN_HELP_MODE]
self._help_metrics[self.ws.MAIN_HELP_MODE_PAGE_4] = self._help_metrics[self.ws.MAIN_HELP_MODE]
if self._cnf.browsing_station_service and not from_keyboard:
self._show_main_help_page_from_browser()

def _show_main_help_page_2(self):
def _show_main_help_page_2(self, from_keyboard=False):
txt = '''!Playlist editing
a| / |A |Add / append new station.
e |Edit current station.
Expand All @@ -1882,7 +1884,7 @@ def _show_main_help_page_2(self):
mode_to_set=self.ws.MAIN_HELP_MODE_PAGE_2,
reset_metrics=False)

def _show_main_help_page_3(self):
def _show_main_help_page_3(self, from_keyboard=False):
txt = '''p |Paste unnamed register.
!Extra Command mode (\\)
\\ |Open previous playlist.
Expand All @@ -1905,7 +1907,7 @@ def _show_main_help_page_3(self):
mode_to_set=self.ws.MAIN_HELP_MODE_PAGE_3,
reset_metrics=False)

def _show_main_help_page_4(self):
def _show_main_help_page_4(self, from_keyboard=False):
txt = '''!Mouse Support
Click |Change selection.
Double click |Start / stop the player.
Expand All @@ -1923,12 +1925,17 @@ def _show_main_help_page_4(self):
\\\\ q Escape |Close Browser (go back in history).
|Search history navigation works with normal keys as well
|(|^N| is the same as |n| when not in a line editor).
'''
|(|^N| is the same as |n| when not in a line editor).'''
self._show_help(txt,
mode_to_set=self.ws.MAIN_HELP_MODE_PAGE_4,
reset_metrics=False)

def _show_main_help_page_from_browser(self):
if self._cnf._online_browser.BROWSER_NAME == 'RadioBrowser':
self.ws.close_window()
self._show_main_help_page_4()
self._main_help_id = 3

def _show_playlist_help(self):
txt = '''Up|,|j|,|PgUp|,
Down|,|k|,|PgDown |Change register selection.
Expand Down Expand Up @@ -5985,6 +5992,8 @@ def keypress(self, char):
self._show_main_help_page_2,
self._show_main_help_page_3,
self._show_main_help_page_4)
if self._main_help_id >= len(func):
self._main_help_id = len(func) - 1
if char == ord('n'):
self._main_help_id += 1
if self._main_help_id == len(func):
Expand All @@ -5994,7 +6003,7 @@ def keypress(self, char):
if self._main_help_id < 0:
self._main_help_id = len(func) - 1
self.ws.close_window()
func[self._main_help_id]()
func[self._main_help_id](from_keyboard=True)
return
self._handle_passive_windows()
return
Expand Down

0 comments on commit 3347185

Please sign in to comment.