Skip to content

Commit af91878

Browse files
committed
- adding pyradio-client man page
- adding client.md and client.html - ranaming stations-logos dir to logos and moving it in the CACHE dir - logos_dir is now in XdgDirs - updating docs
1 parent d87e9cf commit af91878

15 files changed

+306
-73
lines changed

devel/build_install_pyradio

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function uninstall_sudo(){
136136
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
137137
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
138138
sudo rm -f /usr/share/man/man1/pyradio_server.1.gz 2>/dev/null || sudo rm -f /usr/local/share/man/man1/pyradio_server.1.gz 2>/dev/null
139+
sudo rm -f /usr/share/man/man1/pyradio-client.1.gz 2>/dev/null || sudo rm -f /usr/local/share/man/man1/pyradio-client.1.gz 2>/dev/null
139140
echo done
140141
#set -x
141142
remove_paths
@@ -486,10 +487,12 @@ then
486487
gzip -k pyradio_rb.1
487488
gzip -k pyradio_rec.1
488489
gzip -k pyradio_server.1
490+
gzip -k pyradio-client.1
489491
mkdir -p ~/.local/share/man/man1 2>/dev/null
490492
mv -f pyradio.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio.1.gz ~/.local/local/share/man/man1
491493
mv -f pyradio_rb.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_rb.1.gz ~/.local/local/share/man/man1
492494
mv -f pyradio_server.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_server.1.gz ~/.local/local/share/man/man1
495+
mv -f pyradio-client.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio-client.1.gz ~/.local/local/share/man/man1
493496
mv -f pyradio_rec.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_rec.1.gz ~/.local/local/share/man/man1
494497
DOC=~/.local/share/doc/pyradio
495498
mkdir -p "$DOC" 2>/dev/null

devel/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ for afile in index.md \
138138
packaging.md \
139139
themes.md \
140140
headless.md \
141+
client.md \
141142
rec-dir.md
142143
do
143144
echo -ne '.'
@@ -157,6 +158,8 @@ do
157158
echo '% PyRadio RadioBrowser Implementation' > tmp.md
158159
elif [ "$afile" = "desktop-notification.md" ];then
159160
echo '% PyRadio Desktop Notifications' > tmp.md
161+
elif [ "$afile" = "client.md" ];then
162+
echo '% PyRadio Remote Control Client' > tmp.md
160163
elif [ "$afile" = "server.md" ];then
161164
echo '% PyRadio Remote Control Server' > tmp.md
162165
elif [ "$afile" = "linux.md" ];then

docs/client.html

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>PyRadio Remote Control Client</title>
8+
<style>
9+
body {padding: 2em;}
10+
@media screen and (max-width: 770px) {
11+
body {padding: 10px;}
12+
}
13+
body {max-width: 750px; margin: auto;}
14+
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
15+
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
16+
h4 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;}
17+
h4:before {content: "# "; font-weight: bold; vertical-align: middle;}
18+
h5 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;;}
19+
h5:before {content: "## "; font-weight: bold; vertical-align: middle;}
20+
p, table, ol, ul {margin-left: .8em;}
21+
STRONG {color: SaddleBrown;}
22+
dl {margin: 2em;}
23+
dd {margin: 1em;}
24+
dt {font-weight: bold;}
25+
TABLE {border: 1px solid SaddleBrown; border-collapse: collapse; margin-left: auto; margin-right: auto; border-radius: 5px; -moz-border-radius: 5px; border-collapse:separate; box-shadow: 5px 5px 15px #888888;}
26+
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
27+
TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;}
28+
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;}
29+
.task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;}
30+
img{display: block; margin-left: auto; margin-right: auto; max-width: 750px; 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;}
31+
.indented {text-indent: -1.5em; padding-left: 1.5em; margin-left: 1em;}
32+
a{ color: SaddleBrown;}
33+
a:visited{color: SaddleBrown;}
34+
</style>
35+
<!--[if lt IE 9]>
36+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
37+
<![endif]-->
38+
</head>
39+
<body>
40+
<header id="title-block-header">
41+
</header>
42+
<h1 style="color: SaddleBrown" id="pyradio-remote-control-client">PyRadio Remote Control Client</h1>
43+
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
44+
<!-- vim-markdown-toc Marked -->
45+
<ul>
46+
<li><a href="#remote-control-client">Remote Control Client</a>
47+
<ul>
48+
<li><a href="#command-line-parameters">Command line parameters</a></li>
49+
<li><a href="#how-it-works">How it works</a></li>
50+
</ul></li>
51+
</ul>
52+
<!-- vim-markdown-toc -->
53+
<p class="indented">[ <a href="index.html#remote-control-server">Return to main doc</a> ]</p>
54+
<h2 id="remote-control-client">Remote Control Client <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
55+
<p><strong>PyRadio</strong> comes with a client to be used in conjunction with the <strong>Remote Control Server</strong> provided by the program, using the server’s text command set.</p>
56+
<p>The <strong>client</strong> is created with maximum ease in mind; the user does not even have to provide the IP and PORT.</p>
57+
<h3 id="command-line-parameters">Command line parameters</h3>
58+
<p>The following is the output of the “<strong>pyradio -h</strong>” command:</p>
59+
<pre>Usage: pyradio-client [-h] [--address] [-s SERVER_AND_PORT] [-r] [-t TIMEOUT]
60+
[command]
61+
62+
PyRadio Remote Control Client
63+
64+
General options:
65+
-h, --help Show this help message and exit
66+
--address List available servers
67+
68+
Server Parameters:
69+
-s SERVER_AND_PORT, --server_and_port SERVER_AND_PORT
70+
Set the servers&#39;s IP and PORT (format: IP:PORT)
71+
-r, --reverse-detection
72+
Reverse server detection (when no server IP and PORT
73+
specified); detect headless server last, instead of
74+
headless server first
75+
-t TIMEOUT, --timeout TIMEOUT
76+
Set the timeout (default = 1.0)
77+
command The command to send to the server
78+
</pre>
79+
<h3 id="how-it-works">How it works</h3>
80+
<p>The client will auto-detect the <strong>PyRadio Servers</strong> running on the system, when the “<em>-s</em>” command line parameter is not used.</p>
81+
<p>The auto-detection functionality is based on parsing the “<em>server files</em>” (residing in the STATE directory).</p>
82+
<p>If both a <strong>headless</strong> and a <strong>normal</strong> instance of <strong>PyRadio</strong> are detected, the <strong>headless</strong> server will be used to send the requested command, unless the “<em>-r</em>” (“<em>–reverse-detection</em>”) command line parameter is used.</p>
83+
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> A <strong>normal</strong> server is a server started by a <strong>PyRadio</strong> instance which is executed on a real terminal, without the “<em>–headless</em>” command line parameter.</p>
84+
<p>A list of available commands will be displayed when no command has been specified.</p>
85+
<p>A list of detected servers (and their address) can be obtained using the command:</p>
86+
<pre>$ pyradio-client --addr
87+
88+
PyRadio Remote Control Server
89+
Headless server: 127.0.0.1:11111
90+
Server: 127.0.0.1:9998</pre>
91+
<p>Then, the <strong>address</strong> reported can be used to contact a specific server:</p>
92+
<pre>pyradio-client -s 127.0.0.1:9998 i</pre>
93+
<p>The previous command will get the info page of the <strong>normal</strong> instance of a server.</p>
94+
</body>
95+
</html>

docs/client.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# PyRadio Remote Control Client
2+
3+
## Table of Contents
4+
<!-- vim-markdown-toc Marked -->
5+
6+
* [Remote Control Client](#remote-control-client)
7+
* [Command line parameters](#command-line-parameters)
8+
* [How it works](#how-it-works)
9+
10+
<!-- vim-markdown-toc -->
11+
12+
[ [Return to main doc](index.md#remote-control-server) ]
13+
14+
## Remote Control Client
15+
16+
**PyRadio** comes with a client to be used in conjunction with the **Remote Control Server** provided by the program, using the server's text command set.
17+
18+
The **client** is created with maximum ease in mind; the user does not even have to provide the IP and PORT.
19+
20+
### Command line parameters
21+
22+
The following is the output of the "**pyradio -h**" command:
23+
24+
```
25+
Usage: pyradio-client [-h] [--address] [-s SERVER_AND_PORT] [-r] [-t TIMEOUT]
26+
[command]
27+
28+
PyRadio Remote Control Client
29+
30+
General options:
31+
-h, --help Show this help message and exit
32+
--address List available servers
33+
34+
Server Parameters:
35+
-s SERVER_AND_PORT, --server_and_port SERVER_AND_PORT
36+
Set the servers's IP and PORT (format: IP:PORT)
37+
-r, --reverse-detection
38+
Reverse server detection (when no server IP and PORT
39+
specified); detect headless server last, instead of
40+
headless server first
41+
-t TIMEOUT, --timeout TIMEOUT
42+
Set the timeout (default = 1.0)
43+
command The command to send to the server
44+
45+
```
46+
47+
### How it works
48+
49+
The client will auto-detect the **PyRadio Servers** running on the system, when the "*-s*" command line parameter is not used.
50+
51+
The auto-detection functionality is based on parsing the "*server files*" (residing in the STATE directory).
52+
53+
If both a **headless** and a **normal** instance of **PyRadio** are detected, the **headless** server will be used to send the requested command, unless the "*-r*" ("*--reverse-detection*") command line parameter is used.
54+
55+
**Note:** A **normal** server is a server started by a **PyRadio** instance which is executed on a real terminal, without the "*--headless*" command line parameter.
56+
57+
A list of available commands will be displayed when no command has been specified.
58+
59+
A list of detected servers (and their address) can be obtained using the command:
60+
61+
```
62+
$ pyradio-client --addr
63+
64+
PyRadio Remote Control Server
65+
Headless server: 127.0.0.1:11111
66+
Server: 127.0.0.1:9998
67+
```
68+
Then, the **address** reported can be used to contact a specific server:
69+
70+
pyradio-client -s 127.0.0.1:9998 i
71+
72+
The previous command will get the info page of the **normal** instance of a server.
73+
74+

docs/index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
163163
<li><a href="#session-unlocking">Session unlocking</a></li>
164164
</ul></li>
165165
<li><a href="#update-notification">Update notification</a></li>
166-
<li><a href="#remote-control-server">Remote Control Server</a></li>
166+
<li><a href="#remote-control-server">Remote Control Server</a>
167+
<ul>
168+
<li><a href="#remote-control-client">Remote Control Client</a></li>
169+
</ul></li>
167170
<li><a href="#debug-mode">Debug mode</a></li>
168171
<li><a href="#reporting-bugs">Reporting bugs</a></li>
169172
<li><a href="#packaging-pyradio">Packaging PyRadio</a></li>
@@ -2060,6 +2063,9 @@ <h2 id="remote-control-server">Remote Control Server <span style="padding-left:
20602063
<p><strong>PyRadio</strong> can be controlled remotely using normal http requests either form the command line (with <em>curl</em> for example) or from a browser.</p>
20612064
<p>For more information, please refer to <a href="server.html">the relevant page</a>.</p>
20622065
<p>If you’d like to set up a “headless” <strong>PyRadio</strong> operation for your linux box, please refer to the <a href="headless.html">Headless</a> page.</p>
2066+
<h3 id="remote-control-client">Remote Control Client</h3>
2067+
<p><strong>PyRadio</strong> comes with its own client, which will make it easier to communicate with the <strong>Remote Control Server</strong>.</p>
2068+
<p>For more information, please refer to <a href="client.html">the relevant page</a>.</p>
20632069
<h2 id="debug-mode">Debug mode <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
20642070
<p>Adding the “<strong>-d</strong>” option to the command line will instruct <strong>PyRadio</strong> to enter <em>Debug mode</em>, which means that it will print debug messages to a file. This file will always reside in the user’s home directory and will be named <em>pyradio.log</em>.</p>
20652071
<p>In case of a bug or a glitch, please include this file to the issue you will <a target="_blank" href="https://github.com/coderholic/pyradio/issues">open at github</a>.</p>

docs/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ To ensure the correct operation, please take these actions:
110110
* [Session unlocking](#session-unlocking)
111111
* [Update notification](#update-notification)
112112
* [Remote Control Server](#remote-control-server)
113+
* [Remote Control Client](#remote-control-client)
113114
* [Debug mode](#debug-mode)
114115
* [Reporting bugs](#reporting-bugs)
115116
* [Packaging PyRadio](#packaging-pyradio)
@@ -1149,6 +1150,12 @@ For more information, please refer to [the relevant page](server.md).
11491150

11501151
If you'd like to set up a "headless" **PyRadio** operation for your linux box, please refer to the [Headless](headless.md) page.
11511152

1153+
### Remote Control Client
1154+
1155+
**PyRadio** comes with its own client, which will make it easier to communicate with the **Remote Control Server**.
1156+
1157+
For more information, please refer to [the relevant page](client.md).
1158+
11521159
## Debug mode
11531160

11541161
Adding the "**-d**" option to the command line will instruct **PyRadio** to enter *Debug mode*, which means that it will print debug messages to a file. This file will always reside in the user's home directory and will be named *pyradio.log*.

docs/pyradio-client.1

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.TH pyradio-client 1 "May 2024" pyradio
2+
3+
.SH Name
4+
.PP
5+
pyradio-client \- a Remote Control Client for PyRadio
6+
7+
.SH \fBRemote\ Control\ Client
8+
.P
9+
\f[B]PyRadio\f[R] comes with a client to be used in conjunction with the
10+
\f[B]Remote Control Server\f[R] provided by the program, using the
11+
server\[cq]s text command set.
12+
.PP
13+
The \f[B]client\f[R] is created with maximum ease in mind; the user does
14+
not even have to provide the IP and PORT.
15+
.SH Command line parameters
16+
The following is the output of the \[lq]\f[B]pyradio-client -h\f[R]\[rq]
17+
command:
18+
.P
19+
\fIUsage: \fBpyradio-client\fI [\fB-h\fI] [\fB--address\fI] [\fB-s\fI SERVER_AND_PORT] [\fB-r\fI]
20+
[\fB-t\fI TIMEOUT] [command]
21+
22+
PyRadio Remote Control Client
23+
24+
General options:
25+
\fB-h\fI, \fB--help\fI Show this help message and exit
26+
\fB--address\fI List available servers
27+
28+
Server Parameters:
29+
\fB-s\fI SERVER_AND_PORT, \fB--server_and_port\fI SERVER_AND_PORT
30+
Set the servers\[aq]s IP and PORT (format: IP:PORT)
31+
\fB-r\fI, \fB--reverse-detection\fI
32+
Reverse server detection (when no server IP and PORT
33+
specified); detect headless server last, instead of
34+
headless server first
35+
\fB-t\fI TIMEOUT, \fB--timeout\fI TIMEOUT
36+
Set the timeout (default = 1.0)
37+
command The command to send to the server
38+
.EE
39+
.SH How it works
40+
The client will auto-detect the \f[B]PyRadio Servers\f[R] running on the
41+
system, when the \[lq]\f[I]-s\f[R]\[rq] command line parameter is not
42+
used.
43+
.PP
44+
The auto-detection functionality is based on parsing the
45+
\[lq]\f[I]server files\f[R]\[rq] (residing in the STATE directory).
46+
.PP
47+
If both a \f[B]headless\f[R] and a \f[B]normal\f[R] instance of
48+
\f[B]PyRadio\f[R] are detected, the \f[B]headless\f[R] server will be
49+
used to send the requested command, unless the \[lq]\f[I]-r\f[R]\[rq]
50+
(\[lq]\f[I]\[en]reverse-detection\f[R]\[rq]) command line parameter is
51+
used.
52+
.IP \fBNote:
53+
A \f[B]normal\f[R] server is a server started by a \f[B]PyRadio\f[R]
54+
instance which is executed on a real terminal, without the
55+
\[lq]\f[I]\[en]\[en]headless\f[R]\[rq] command line parameter.
56+
.PP
57+
A list of available commands will be displayed when no command has been
58+
specified.
59+
.PP
60+
A list of detected servers (and their address) can be obtained
61+
using the command:
62+
.IP
63+
.EX
64+
\fI$ pyradio-client --addr
65+
66+
PyRadio Remote Control Server
67+
Headless server: 127.0.0.1:11111
68+
Server: 127.0.0.1:9998
69+
.EE
70+
.PP
71+
Then, the \f[B]address\f[R] reported can be used to contact a specific
72+
server:
73+
.IP
74+
.EX
75+
\fIpyradio-client -s 127.0.0.1:9998 i
76+
.EE
77+
.PP
78+
The previous command will get the info page of the \f[B]normal\f[R]
79+
instance of a server.
80+
81+
.SH See also
82+
83+
pyradio_server(1)
84+
85+
pyradio(1)

docs/pyradio.1

+2
Original file line numberDiff line numberDiff line change
@@ -1977,3 +1977,5 @@ RadioBrowser Implementation
19771977
Recording stations
19781978
.IP \fIpyradio_server(1)
19791979
Remote Control Server
1980+
.IP \fIpyradio-client(1)
1981+
Remote Control Client

docs/pyradio_server.1

+3
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,7 @@ Furthermore, using it from a browser, clicking or tapping the corresponding butt
360360

361361
.SH See also
362362

363+
pyradio-client(1)
364+
363365
pyradio(1)
366+

pyradio/config

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ enable_notifications = -1
7979
use_station_icon = True
8080

8181
# Cached Station Icons Handling
82-
# If use_station_incon is True, stations' icons will be saved under the
83-
# DATA_DIR, in a folder called staions-logos.
82+
# If use_station_incon is True, stations' icons will be cached in the logos folder.
8483
# If this option is True (the default), all files under this folder will be
8584
# deleted at program exit. Otherwise, all downloaded logos will remain in the
8685
# folder for future use.

0 commit comments

Comments
 (0)