Skip to content

Commit

Permalink
- Version 0.8.9.1
Browse files Browse the repository at this point in the history
- implementing "Listening" mode
  • Loading branch information
s-n-g committed Apr 14, 2021
1 parent 176c741 commit 036c340
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 67 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2021-04-14 s-n-g
* Version 0.8.9.1
* Implemented the so called "Listening" mode, in which PyRadio TUI
can be reduced down to a single line (the "Status Bar"). Requested
for tilling WM use (#128)[https://github.com/coderholic/pyradio/issues/128]

2021-04-03 s-n-g
* Version 0.8.9
* Implemented a simplified method to install, update, uninstall.
Expand Down
9 changes: 6 additions & 3 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
<li><a href="#installation">Installation</a></li>
<li><a href="#command-line-options">Command line options</a></li>
<li><a href="#controls">Controls</a></li>
<li><a href="#pyradio&#39;s-modes">PyRadio’s Modes</a></li>
<li><a href="#pyradio-modes">PyRadio Modes</a></li>
<li><a href="#config-file">Config file</a></li>
<li><a href="#about-playlist-files">About Playlist files</a>
<ul>
Expand Down Expand Up @@ -106,6 +106,7 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
<li>python 2.7/3.5+
<ul>
<li>requests</li>
<li>dnspython</li>
</ul></li>
<li>MPV, MPlayer or VLC installed and in your path</li>
</ul>
Expand Down Expand Up @@ -208,13 +209,14 @@ <h2 id="controls">Controls <span style="padding-left: 10px;"><sup style="font-si
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> All windows - except the <em>Search window</em> - support changing the volume and muting / unmuting the player (provided that <strong>PyRadio</strong> is actually connected to a station).</p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> When inserting numbers (either to jump to a station or to move a station), the number will be displayed at the right bottom corner of the window, suffixed by a “<em>G</em>”, i.e. pressing <em>35</em> will display <em>[35G]</em>.</p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> When tagging a station position for a move action (by pressing “<strong>J</strong>”), the position will be displayed at the right bottom corner of the window, suffixed by a “<em>J</em>”, i.e. pressing “<em>J</em>” on position <em>35</em> will display <em>[35J]</em>.</p>
<h2 id="pyradios-modes">PyRadio’s Modes <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<h2 id="pyradio-modes">PyRadio Modes <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p><strong>PyRadio</strong> has the following primary modes:</p>
<ol type="1">
<li>The <strong>Main</strong> mode, which is the one you get when you open the program, showing you a list of stations (a playlist), that you can play and edit; this is why it is also called the <strong>editing mode</strong>. All other modes derive from this one, and it’s the mode you have to get to in order to terminate the program.</p></li>
<li>The <strong>Playlist</strong> mode, which you can open by pressing “<strong>o</strong>”. Then you can open, create, paste a station, etc.</p></li>
<li>The <strong>Registers</strong> mode. This is identical to the “<em>Playlist</em>” mode, but instead of displaying playlists, it displays register. You can enter this mode by pressing “<strong>’’</strong>” (two single quotes) and exit from it by pressing “<strong>Esc</strong>” or “<strong>q</strong>”. You can also press “<strong></strong>” (single quote) to get to the <strong>Playlist</strong> mode and back.</p></li>
<li>The <strong>Register Main</strong> mode, which is identical to the “<em>Main</em>” mode, except it displays the content of a <strong>named</strong> register.</p></li>
<li>The <strong>Listening</strong> mode, which is intended to be used when you want <strong>PyRadio</strong> to just play your favorite station and not take up too much space. It is ideal for tilling window manager use, as the whole TUI can be reduced all the way down to a single line (displaying the “<em>Status Bar</em>”). In this mode, adjusting, muting and saving the volume are the only action available. To get <strong>PyRadio</strong> back to normal operation one would just resize its window to a reasonable size (7 lines vertically, or more).</p></li>
</ol>
<p>A set of <strong>secondary modes</strong> is also available (a secondary mode works within a primary one):</p>
<ol type="1">
Expand Down Expand Up @@ -580,7 +582,8 @@ <h2 id="reporting-bugs">Reporting bugs <span style="padding-left: 10px;"><sup st
<p>Finally, include the file produced in your report.</p>
<h2 id="packaging-pyradio">Packaging Pyradio <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>If you are a packager and would like to produce a package for your distribution please do follow this mini guide.</p>
<p><strong>PyRadio</strong> is able to update and uninstall itself, when installed from source. This is something you do not want to be happening when your package is used; <strong>PyRadio</strong> should be updated and uninstalled using the distro package manager.</p>
<p>First of all, make sure you declare the pacakges’s requirements to the relevant section of your manifest (or whatever) file. These are: 1. requests 2. dnspython</p>
<p>After that, you will have to modify some files, because <strong>PyRadio</strong> is able to update and uninstall itself, when installed from source. This is something you do not want to be happening when your package is used; <strong>PyRadio</strong> should be updated and uninstalled using the distro package manager.</p>
<p>In order to accomplice that, you just have to change the <strong>distro</strong> configuration parameter in the <strong>config</strong> file. <strong>PyRadio</strong> will read this parameter and will disable updating and uninstalling, when set to anything other than “<strong>None</strong>”. So, here’s how you do that:</p>
<p>Once you are in the sources top level directory (typically “<em>pyradio</em>”), you execute the command:</p>
<pre>sed -i &#39;s/distro = None/distro = YOUR DISTRO NAME/&#39; pyradio/config</pre>
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
* [Installation](#installation)
* [Command line options](#command-line-options)
* [Controls](#controls)
* [PyRadio's Modes](#pyradio's-modes)
* [PyRadio Modes](#pyradio-modes)
* [Config file](#config-file)
* [About Playlist files](#about-playlist-files)
* [Integrating new stations](#integrating-new-stations)
Expand Down Expand Up @@ -57,6 +57,7 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
## Requirements
* python 2.7/3.5+
- requests
- dnspython
* MPV, MPlayer or VLC installed and in your path

## Installation
Expand Down Expand Up @@ -171,7 +172,7 @@ The same logic applies to all **PyRadio** windows.
**Note:** When tagging a station position for a move action (by pressing "**J**"), the position will be displayed at the right bottom corner of the window, suffixed by a "*J*", i.e. pressing "*J*" on position *35* will display *[35J]*.


## PyRadio's Modes
## PyRadio Modes

**PyRadio** has the following primary modes:

Expand All @@ -183,6 +184,8 @@ The same logic applies to all **PyRadio** windows.

4. The **Register Main** mode, which is identical to the "*Main*" mode, except it displays the content of a **named** register.

5. The **Listening** mode, which is intended to be used when you want **PyRadio** to just play your favorite station and not take up too much space. It is ideal for tilling window manager use, as the whole TUI can be reduced all the way down to a single line (displaying the "*Status Bar*"). In this mode, adjusting, muting and saving the volume are the only action available. To get **PyRadio** back to normal operation one would just resize its window to a reasonable size (7 lines vertically, or more).

A set of **secondary modes** is also available (a secondary mode works within a primary one):

1. The **Extra Commands** mode, which gives you access to extra commands. You can enter this mode by pressing "**\\**" (backslash). Then a backslash is displayed at the bottom right corner of the window.
Expand Down Expand Up @@ -730,7 +733,11 @@ Finally, include the file produced in your report.

If you are a packager and would like to produce a package for your distribution please do follow this mini guide.

**PyRadio** is able to update and uninstall itself, when installed from source. This is something you do not want to be happening when your package is used; **PyRadio** should be updated and uninstalled using the distro package manager.
First of all, make sure you declare the pacakges's requirements to the relevant section of your manifest (or whatever) file. These are:
1. requests
2. dnspython

After that, you will have to modify some files, because **PyRadio** is able to update and uninstall itself, when installed from source. This is something you do not want to be happening when your package is used; **PyRadio** should be updated and uninstalled using the distro package manager.

In order to accomplice that, you just have to change the **distro** configuration parameter in the **config** file. **PyRadio** will read this parameter and will disable updating and uninstalling, when set to anything other than "**None**". So, here's how you do that:

Expand Down
1 change: 1 addition & 0 deletions devel/build_install_pyradio.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ IF "%1"=="" (
pip install windows-curses --upgrade 1>NUL 2>NUL
pip install pywin32 --upgrade 1>NUL 2>NUL
pip install requests --upgrade 1>NUL 2>NUL
pip install dnspython --upgrade 1>NUL 2>NUL
)

IF '%1'=='ELEV' ( GOTO START ) ELSE ( ECHO Running elevated in a different window)
Expand Down
3 changes: 3 additions & 0 deletions pyradio.1
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ The \fBRegisters\fR mode. This is identical to the "\fIPlaylist\fR" mode, but in
.IP 4. 3
The \fBRegister Main\fR mode, which is identical to the "\fIMain\fR" mode, except it displays the content of a \fBnamed\fR register.

.IP 5. 3
The \fBListening\fR mode, which is intended to be used when you want \fBpyradio\fR to just play your favorite station and not take up too much space. It is ideal for tilling window manager use, as the whole TUI can be reduced all the way down to a single line (displaying the "\fIStatus Bar\fR"). In this mode, adjusting, muting and saving the volume are the only actions available. To get \fBpyradio\fR back to normal operation one would just resize its window to a reasonable size (7 lines vertically, or more).

.RE

A set of \fBsecondary modes\fR is also available (a secondary mode works within a primary one):
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)
version_info = (0, 8, 9, 1)

# Application state:
# New stable version: ''
Expand Down
2 changes: 1 addition & 1 deletion pyradio/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def __init__(self,
'term': 'big band',
'param': {'order': 'votes', 'reverse': 'true'},
})
self._search_history_index = 1
self._search_history_index = 0

self.search()

Expand Down
5 changes: 3 additions & 2 deletions pyradio/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ def update_or_uninstall_on_windows(self, mode='update'):
os.makedirs(self._dir, exist_ok=True)
if mode.startswith('update'):
bat = os.path.join(self._dir, 'update.bat')
PyRadioUpdateOnWindows.print_update_bat_created()
os.system('CLS')
# PyRadioUpdateOnWindows.print_update_bat_created()
else:
bat = os.path.join(self._dir, 'uninstall.bat')
os.system('CLS')
PyRadioUpdateOnWindows.print_uninstall_bat_created()
# PyRadioUpdateOnWindows.print_uninstall_bat_created()
try:
with open(bat, "w") as b:
b.write('@ECHO OFF\n')
Expand Down
Loading

0 comments on commit 036c340

Please sign in to comment.