diff --git a/Changelog b/Changelog index d9e0ffd4..1cb5391a 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,11 @@ +2022-04-29 s-n-g + * version 0.8.9.17 (0.9-beta13) + * adding Title's Log + * changing versioning + * fixing user isntallation in build_install_pyradio + * fixing python2 main.py crash (#153) + * updating docs + 2022-03-15 s-n-g * version 0.8.9.15 (0.9-beta12) * fixing "0" and "$" insertion on RadioBrowser search window diff --git a/README.html b/README.html index 9c37ec05..8af34c88 100644 --- a/README.html +++ b/README.html @@ -24,7 +24,7 @@ TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;} pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;} .task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;} - img{display: block; margin-left: auto; margin-right: auto; max-width: 600px; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;} + img{display: block; margin-left: auto; margin-right: auto; max-width: 750; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;} a{ color: SaddleBrown;} a:visited{color: SaddleBrown;} @@ -39,6 +39,7 @@
Command line internet radio player.
Ben Dowling - https://github.com/coderholic
++2022-04-29 s-n-g + * version 0.8.9.17 (0.9-beta13) + * adding Title's Log + * changing versioning + * fixing user isntallation in build_install_pyradio + * fixing python2 main.py crash (#153) + * updating docs + 2022-03-15 s-n-g * version 0.8.9.15 (0.9-beta12) * fixing "0" and "$" insertion on RadioBrowser search window @@ -826,6 +839,7 @@Tiling manager modes
Note: These two modes do not work on Windows, either 7 or 10. The “Console”window will shrink as desired, but will not always notify PyRadio about it, so results will vary.
PyRadio upon its execution tries to read its configuration file (i.e. ~/.config/pyradio/config). If this file is not found, it will be created. If an error occurs while parsing it, an error message will be displayed and PyRadio will terminate.
@@ -924,6 +938,7 @@The Line editor supports the insertion of CJK Unified Ideographs, as described on CJK Unified Ideographs (Unicode block) also known as URO, abbreviation of Unified Repertoire and Ordering. These characters, although encoded as a single code-point (character), actually take up a 2-character space, when rendered on the terminal.
A depiction of the editor’s behavior can be seen at this image:
+Rearranging the order of the stations in the playlist is another feature PyRadio offers.
All you have to do is specify the source station (the station to be moved) and the position it will be moved to (target).
@@ -1021,6 +1036,7 @@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.
+Each of the supported players can have up to 11 sets of extra parameters (the first one is the default).
The user can add (“a”) a new parameter, edit (“e”) an existing set and delete (“x” or “DEL”) one.
If these two names are not identical, the user can press “r” to rename the station in the playlist using the “Reported Name”. This way an unknown station (when only the URL is known) can be correctly identified (after being inserted in a playlist with a dummy station name).
PyRadio takes the concept of registers from vim, and adapts their function to its own needs. So this is how it all works.
@@ -1131,6 +1148,10 @@Then, the mouse can be used as follows:
Action | @@ -1160,6 +1181,34 @@
---|
Version 0.8.9.17 adds to PyRadio the ability to log the titles displayed at the bottom of its window, in a log file, for refference.
+The logger, which works independantly from the “degub” function, is actually a Rotating File Handler, configured to write up to 5 files of around 50KB each (parameters maxBytes=50000 and backupCount=5).
+The way this works, according to the documenataion, is that one “can use the maxBytes and backupCount values to allow the file to rollover at a predetermined size. When the size is about to be exceeded, the file is closed and a new file is silently opened for output. Rollover occurs whenever the current log file is nearly maxBytes in length… When backupCount is non-zero, the system will save old log files by appending the extensions ‘.1’, ‘.2’ etc., to the filename. For example, with a backupCount of 5 and a base file name of app.log, you would get app.log, app.log.1, app.log.2, up to app.log.5. The file being written to is always app.log. When this file is filled, it is closed and renamed to app.log.1, and if files app.log.1, app.log.2, etc. exist, then they are renamed to app.log.2, app.log.3 etc. respectively.
+The function can be enabled:
+The titles are written in a file called pyradio-titles.log which is saved at PyRadio configuration directory.
+Log file sample:
+Apr 18 (Mon) 13:12 | >>> Station: Lounge (Illinois Street Lounge - SomaFM) +Apr 18 (Mon) 13:12 | Jack Costanzo - La Cumparsa, Harlem Nocturne +Apr 18 (Mon) 13:14 | Don Baker Trio - Third Man Theme +Apr 18 (Mon) 13:16 | Gillian Hills - Un Petit Baiser+
An extra functionality is made possible because of “titles’s logging”: tagging a title (something like liking a song).
+The idea is that the user plays a station and hears a song he likes and want to look it up later. With this functionality, he can tag the song (make a note in the log file), so he can refer to it at a later time.
+To tag a title, one has to press the “w” key.
+Then, if titles’s logging is already enabled, the log file will have an entry similar to the one shown below:
+Apr 18 (Mon) 13:39 | Tom Russell - Bus Station +Apr 18 (Mon) 13:40 | Tom Russell - Bus Station (LIKED)+
If title’s logging is not enabled, it will be turned on, the song will be tagged and logging will be turned off again:
+Apr 18 (Mon) 15:38 | === Logging started +Apr 18 (Mon) 15:38 | >>> Station: Folk (Folk Forward - SomaFM) +Apr 18 (Mon) 15:38 | Lord Huron - Lullaby +Apr 18 (Mon) 15:38 | Lord Huron - Lullaby (LIKED) +Apr 18 (Mon) 15:38 | === Logging stopped
PyRadio supports the following Online radio directory services:
Use your distribution method to install
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py sudo python[2] get-pip.py
When you are done, proceed to “Performing the installation”.
+If installing on a Rasberry Pi, there are a couple of things you should be aware of:
+First thing you do is install python dependencies (assuming python 3 is installed):
-pip3 install --upgrade wheel requests dnspython psutil+
python3 -m pip install --upgrade wheel setuptools requests dnspython psutil
Everything else you need to install and run pyradio is available on Homebrew. If you haven’t already downloaded its client, go ahead and do it.
Open a terminal and type:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"@@ -133,7 +142,7 @@
This release of PyRadio has been tested on Catalina and Big Sur.
On Catalina the executable has been placed on a location which is not directly accessible (not in the PATH). PyRadio will try to link it to your bin folder (creating ~/bin/pyradio), and PyRadio will be ready yo be executed, provided that this folder is in your PATH and that Homebrew default installation folders have been used during the installation of Python 3.
In case a different Homebrew location has been used (or a different package manager, for this matter), you can just point the installation to the correct path, using the following command (post installation):
diff --git a/build.md b/build.md index c383f012..9cebeba0 100644 --- a/build.md +++ b/build.md @@ -12,10 +12,11 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic) * [Preparing for the installation](#preparing-for-the-installation) * [Linux](#linux) * [Notice for Python 2 users](#notice-for-python-2-users) + * [Rasberry Pi installation](#rasberry-pi-installation) * [macOS](#macos) * [Windows](#windows) * [Performing the installation](#performing-the-installation) - * [Note for macOS users](#note-for-macos-users) + * [Note for macOS users](#note-for-macos-users) * [Updating a pre 0.8.9 installation](#updating-a-pre-0.8.9-installation) @@ -51,6 +52,7 @@ Before installing **PyRadio** you have to prepare your system, so that you end u Use your distribution method to install 1. *python-wheel* +1. *python-setuptools* 2. *python-requests* 3. *python-dnspython* 4. *python-psutil* @@ -72,12 +74,18 @@ If your distro does not provide it (some do not anymore), use the following comm When you are done, proceed to "[Performing the installation](#performing-the-installation)". +#### Rasberry Pi installation + +If installing on a Rasberry Pi, there are a couple of things you should be aware of: + +1. The default player will be **MPlayer** +3. If you still want to use **MPV**, please make sure you increase the *Connection timeout* value to at least 20 (sometimes even 30 for some machines). Even then, your machine may eventually crash, if it's on the lower end of things and **PyRadio** is left running for hours. ### macOS First thing you do is install python dependencies (assuming python 3 is installed): - pip3 install --upgrade wheel requests dnspython psutil + python3 -m pip install --upgrade wheel setuptools requests dnspython psutil Everything else you need to install and run **pyradio** is available on [Homebrew](https://github.com/Homebrew/homebrew). If you haven't already downloaded its client, go ahead and do it. @@ -149,7 +157,7 @@ If for some reason you want a **python 2** installation, execute: python2 install.py -#### Note for macOS users +### Note for macOS users This release of **PyRadio** has been tested on **Catalina** and **Big Sur**. diff --git a/devel/build_install_pyradio b/devel/build_install_pyradio index 2582aa30..f707cc20 100755 --- a/devel/build_install_pyradio +++ b/devel/build_install_pyradio @@ -54,13 +54,37 @@ done < /tmp/pyradio-delete.$$ rm -f /tmp/pyradio-uninstall.$$ /tmp/pyradio-delete.$$ 2>/dev/null } +function remove_pip_sudo_install(){ + sudo python -m pip uninstall -y pyradio 2>/dev/null 1>&2 + sudo python2 -m pip uninstall -y pyradio 2>/dev/null 1>&2 + sudo python3 -m pip uninstall -y pyradio 2>/dev/null 1>&2 +} -function remove_pip_install(){ +function uninstall(){ + echo 'Uninstalling PyRadio' + echo -n ' ** Removing python files ... ' python -m pip uninstall -y pyradio 2>/dev/null 1>&2 python2 -m pip uninstall -y pyradio 2>/dev/null 1>&2 + python3 -m pip uninstall -y pyradio 2>/dev/null 1>&2 + echo 'done' + echo -n ' ** Removing help files ... ' + if [ -d ~/.local/share/doc/pyradio ];then + rm -rf ~/.local/share/doc/pyradio 2>/dev/null + else + rm -rf ~/.local/local/share/doc/pyradio 2>/dev/null + fi + rm -f ~/.local/share/man/man1/pyradio*gz 2>/dev/null + echo 'done' + if [ $(uname -s) = "Darwin" ] || [ $(uname -s) = "darwin" ];then + # delete link on mac + echo -n ' ** Removing link to executable ... ' + [ -h ~/bin/pyradio ] && rm ~/bin/pyradio 2>/dev/null + echo 'done' + fi + echo "PyRadio successfully uninstalled" } -function uninstall(){ +function uninstall_sudo(){ local user [ -z "$1" ] && { user=$(which pyradio 2>/dev/null) || { @@ -68,7 +92,6 @@ function uninstall(){ exit } } - # keep this sudo as to not break lines sudo echo 'Uninstalling PyRadio' echo -n ' ** Removing executable ... ' sudo rm -f `which pyradio 2>/dev/null` 2>/dev/null @@ -77,21 +100,14 @@ function uninstall(){ else sudo rm -rf /usr/local/share/doc/pyradio 2>/dev/null fi - if [ -d ~/.local/share/doc/pyradio ];then - rm -rf ~/.local/share/doc/pyradio 2>/dev/null - else - rm -rf ~/.local/local/share/doc/pyradio 2>/dev/null - fi echo done echo -n ' ** Removing help files ... ' sudo rm -f /usr/share/man/man1/pyradio.1.gz 2>/dev/null || sudo rm -f /usr/local/share/man/man1/pyradio.1.gz 2>/dev/null sudo rm -f /usr/share/man/man1/pyradio_rb.1.gz 2>/dev/null || sudo rm -f /usr/local/share/man/man1/pyradio_rb.1.gz 2>/dev/null - rm -f ~/.local/share/man/man1/pyradio.1.gz 2>/dev/null - rm -f ~/.local/share/man/man1/pyradio_rb.1.gz 2>/dev/null echo done #set -x remove_paths - remove_pip_install + remove_pip_sudo_install if [ $(uname -s) = "Darwin" ] || [ $(uname -s) = "darwin" ];then # delete link on mac [ -h ~/bin/pyradio ] && rm ~/bin/pyradio 2>/dev/null @@ -99,15 +115,6 @@ function uninstall(){ echo "PyRadio successfully uninstalled" } -function create_bdist(){ - rm -rf build pyradio.egg-info dist debian 2>/dev/null - python3 setup.py bdist || { - echo "Error creating bdist" - exit 1 - } - -} - function get_cur_version(){ cur_version=$(grep 'version_info = ' pyradio/__init__.py | sed 's/version_info = (//;s/, /./g;s/)//') cur_state=$(grep 'app_state = ' pyradio/__init__.py | sed "s/app_state = //;s/'//g") @@ -118,8 +125,18 @@ function get_cur_version(){ function do_dev(){ if [ -z "${NO_DEV}" ] then - cp pyradio/config.py pyradio/config.py.dev - sed -i "s/git_description = ''/git_description = '$DEVEL'/" pyradio/config.py + [ -z "$DEVEL" ] && { + rm pyradio/config.pydev 2>/dev/null + return + } + sed -idev "s/git_description = ''/git_description = '$DEVEL'/" pyradio/config.py + fi +} + +function do_undev(){ + if [ -e pyradio/config.pydev ] + then + mv pyradio/config.pydev pyradio/config.py fi } @@ -130,7 +147,7 @@ function do_exit(){ [ "$REMOVE_DIR" = "$HOME/tmp-pyradio" ] || \ [ "$REMOVE_DIR" = "/tmp/pyradio" ] || \ [ "$REMOVE_DIR" = "/tmp/tmp-pyradio" ];then - sudo rm -fr "$REMOVE_DIR" + rm -fr "$REMOVE_DIR" fi fi } @@ -337,13 +354,14 @@ do done set -- "${POSITIONAL[@]}" # restore positional parameters -if [ -z "$NO_DEV" ] -then - cd pyradio - DEVEL=$(python -c 'from install import get_devel_version; print(get_devel_version())') - echo "Devel version: $DEVEL" - cd .. -fi +# if [ -z "$NO_DEV" ] +# then +# cd pyradio +# DEVEL=$(python -c 'from install import get_github_long_description_for_script; get_github_long_description_for_script()') +# # DEVEL=$(python -c 'from install import get_devel_version; print(get_devel_version())') +# echo "Devel version: $DEVEL" +# cd .. +# fi if [ $(uname -s) = "Darwin" ] || [ $(uname -s) = "darwin" ];then @@ -401,9 +419,11 @@ else python"${TO_PYTHON}" -m pip install . fi +do_undev + if [ $? -eq 0 ] then - [ -z "${NO_DEV}" ] && mv pyradio/config.py.dev pyradio/config.py + [ -z "${NO_DEV}" ] && [ -e pyradio/config.py.dev ] && mv pyradio/config.py.dev pyradio/config.py gzip -k pyradio.1 gzip -k pyradio_rb.1 mkdir -p ~/.local/share/man/man1 2>/dev/null diff --git a/devel/build_install_pyradio.bat b/devel/build_install_pyradio.bat index 811e9d41..5757411b 100644 --- a/devel/build_install_pyradio.bat +++ b/devel/build_install_pyradio.bat @@ -49,12 +49,14 @@ FOR /f "delims=" %%i IN ('ECHO %DESKTOP%') DO SET DESKTOP=%%i SET ALL=0 IF "%1"=="-u" GOTO uninstall IF "%1"=="-R" GOTO uninstall +REM Do not run uninstall while installing IF "%1"=="-U" ( SET ALL=1 - GOTO uninstall + REM GOTO uninstall ) IF "%1"=="" GOTO noparam -SET "PROGRAM=python%arg1%" +IF "%arg1%" == "2" SET "PROGRAM=python%arg1%" +IF "%arg1%" == "3" SET "PROGRAM=python%arg1%" :noparam CLS diff --git a/devel/pre-commit b/devel/pre-commit index e82f3a8b..b8abae3a 100755 --- a/devel/pre-commit +++ b/devel/pre-commit @@ -52,7 +52,7 @@ do echo '% PyRadio RadioBrowser Implementation' > tmp.md fi cat ${afile} >> tmp.md - pandoc -s -t html tmp.md -o ${out} || { + pandoc --wrap=none -s -t html tmp.md -o ${out} || { echo "Error: pandoc not found" rm tmp.md exit 1 @@ -83,7 +83,7 @@ do TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;} \ pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;} \ .task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;} \ - img{display: block; margin-left: auto; margin-right: auto; max-width: 600px; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;} \ + img{display: block; margin-left: auto; margin-right: auto; max-width: 750; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;} \ ' ${out} sed -i -e 's///g' \
-e 's{
{{g' \
@@ -117,7 +117,10 @@ do
-e 's|<.strong><.sup>W<.strong>|^W|' \
"$out"
fi
-
+ #sed -i "/^alt=/d" ${out}
+ # sed -i '/To open RadioBrowser one would just press “O” at the program’s main window. Since at this point this is the only service supported, the service will be activated.
+Upon activation, the default query will be preformed and (if successful) its results will be presented to the user. If unsuccessful, a relevant message will be displayed and the program will return to the local playlist that was previously opened.
By default, PyRadio will load the first 100 most voted stations on RadioBrowser.
Note: In case the server returns no results, the window will automatically reopen so that you can redefine the “search term”.
Navigation between the various fields is done using the “Tab” (and “Shift-Tab”) key, the arrows and vim keys (“j”, “k”, “h” and “l”), provided that any given key is not already used by one of the on window “widgets”.
+Toggling the state of check boxes is done by pressing SPACE. The “Display by” and “Search for” check boxes are mutually exclusive (enabling one disables the other). Each of them will give access to more fields when enabled.
To perform a search (server query) one would just press Enter on the “OK” button, or “s” on any widget other than a Line editor.
+This window performs two functions: