Skip to content

Commit

Permalink
- adding pyradio-client man page
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
s-n-g committed May 24, 2024
1 parent d87e9cf commit af91878
Show file tree
Hide file tree
Showing 15 changed files with 306 additions and 73 deletions.
3 changes: 3 additions & 0 deletions devel/build_install_pyradio
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ function uninstall_sudo(){
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
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
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
echo done
#set -x
remove_paths
Expand Down Expand Up @@ -486,10 +487,12 @@ then
gzip -k pyradio_rb.1
gzip -k pyradio_rec.1
gzip -k pyradio_server.1
gzip -k pyradio-client.1
mkdir -p ~/.local/share/man/man1 2>/dev/null
mv -f pyradio.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio.1.gz ~/.local/local/share/man/man1
mv -f pyradio_rb.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_rb.1.gz ~/.local/local/share/man/man1
mv -f pyradio_server.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_server.1.gz ~/.local/local/share/man/man1
mv -f pyradio-client.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio-client.1.gz ~/.local/local/share/man/man1
mv -f pyradio_rec.1.gz ~/.local/share/man/man1 2>/dev/null || mv -f pyradio_rec.1.gz ~/.local/local/share/man/man1
DOC=~/.local/share/doc/pyradio
mkdir -p "$DOC" 2>/dev/null
Expand Down
3 changes: 3 additions & 0 deletions devel/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ for afile in index.md \
packaging.md \
themes.md \
headless.md \
client.md \
rec-dir.md
do
echo -ne '.'
Expand All @@ -157,6 +158,8 @@ do
echo '% PyRadio RadioBrowser Implementation' > tmp.md
elif [ "$afile" = "desktop-notification.md" ];then
echo '% PyRadio Desktop Notifications' > tmp.md
elif [ "$afile" = "client.md" ];then
echo '% PyRadio Remote Control Client' > tmp.md
elif [ "$afile" = "server.md" ];then
echo '% PyRadio Remote Control Server' > tmp.md
elif [ "$afile" = "linux.md" ];then
Expand Down
95 changes: 95 additions & 0 deletions docs/client.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>PyRadio Remote Control Client</title>
<style>
body {padding: 2em;}
@media screen and (max-width: 770px) {
body {padding: 10px;}
}
body {max-width: 750px; margin: auto;}
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
h4 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;}
h4:before {content: "# "; font-weight: bold; vertical-align: middle;}
h5 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;;}
h5:before {content: "## "; font-weight: bold; vertical-align: middle;}
p, table, ol, ul {margin-left: .8em;}
STRONG {color: SaddleBrown;}
dl {margin: 2em;}
dd {margin: 1em;}
dt {font-weight: bold;}
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;}
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
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: 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;}
.indented {text-indent: -1.5em; padding-left: 1.5em; margin-left: 1em;}
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown" id="pyradio-remote-control-client">PyRadio Remote Control Client</h1>
<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>
<!-- vim-markdown-toc Marked -->
<ul>
<li><a href="#remote-control-client">Remote Control Client</a>
<ul>
<li><a href="#command-line-parameters">Command line parameters</a></li>
<li><a href="#how-it-works">How it works</a></li>
</ul></li>
</ul>
<!-- vim-markdown-toc -->
<p class="indented">[ <a href="index.html#remote-control-server">Return to main doc</a> ]</p>
<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>
<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>
<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>
<h3 id="command-line-parameters">Command line parameters</h3>
<p>The following is the output of the “<strong>pyradio -h</strong>” command:</p>
<pre>Usage: pyradio-client [-h] [--address] [-s SERVER_AND_PORT] [-r] [-t TIMEOUT]
[command]

PyRadio Remote Control Client

General options:
-h, --help Show this help message and exit
--address List available servers

Server Parameters:
-s SERVER_AND_PORT, --server_and_port SERVER_AND_PORT
Set the servers&#39;s IP and PORT (format: IP:PORT)
-r, --reverse-detection
Reverse server detection (when no server IP and PORT
specified); detect headless server last, instead of
headless server first
-t TIMEOUT, --timeout TIMEOUT
Set the timeout (default = 1.0)
command The command to send to the server
</pre>
<h3 id="how-it-works">How it works</h3>
<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>
<p>The auto-detection functionality is based on parsing the “<em>server files</em>” (residing in the STATE directory).</p>
<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>
<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>
<p>A list of available commands will be displayed when no command has been specified.</p>
<p>A list of detected servers (and their address) can be obtained using the command:</p>
<pre>$ pyradio-client --addr

PyRadio Remote Control Server
Headless server: 127.0.0.1:11111
Server: 127.0.0.1:9998</pre>
<p>Then, the <strong>address</strong> reported can be used to contact a specific server:</p>
<pre>pyradio-client -s 127.0.0.1:9998 i</pre>
<p>The previous command will get the info page of the <strong>normal</strong> instance of a server.</p>
</body>
</html>
74 changes: 74 additions & 0 deletions docs/client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# PyRadio Remote Control Client

## Table of Contents
<!-- vim-markdown-toc Marked -->

* [Remote Control Client](#remote-control-client)
* [Command line parameters](#command-line-parameters)
* [How it works](#how-it-works)

<!-- vim-markdown-toc -->

[ [Return to main doc](index.md#remote-control-server) ]

## Remote Control Client

**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.

The **client** is created with maximum ease in mind; the user does not even have to provide the IP and PORT.

### Command line parameters

The following is the output of the "**pyradio -h**" command:

```
Usage: pyradio-client [-h] [--address] [-s SERVER_AND_PORT] [-r] [-t TIMEOUT]
[command]
PyRadio Remote Control Client
General options:
-h, --help Show this help message and exit
--address List available servers
Server Parameters:
-s SERVER_AND_PORT, --server_and_port SERVER_AND_PORT
Set the servers's IP and PORT (format: IP:PORT)
-r, --reverse-detection
Reverse server detection (when no server IP and PORT
specified); detect headless server last, instead of
headless server first
-t TIMEOUT, --timeout TIMEOUT
Set the timeout (default = 1.0)
command The command to send to the server
```

### How it works

The client will auto-detect the **PyRadio Servers** running on the system, when the "*-s*" command line parameter is not used.

The auto-detection functionality is based on parsing the "*server files*" (residing in the STATE directory).

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.

**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.

A list of available commands will be displayed when no command has been specified.

A list of detected servers (and their address) can be obtained using the command:

```
$ pyradio-client --addr
PyRadio Remote Control Server
Headless server: 127.0.0.1:11111
Server: 127.0.0.1:9998
```
Then, the **address** reported can be used to contact a specific server:

pyradio-client -s 127.0.0.1:9998 i

The previous command will get the info page of the **normal** instance of a server.


8 changes: 7 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
<li><a href="#session-unlocking">Session unlocking</a></li>
</ul></li>
<li><a href="#update-notification">Update notification</a></li>
<li><a href="#remote-control-server">Remote Control Server</a></li>
<li><a href="#remote-control-server">Remote Control Server</a>
<ul>
<li><a href="#remote-control-client">Remote Control Client</a></li>
</ul></li>
<li><a href="#debug-mode">Debug mode</a></li>
<li><a href="#reporting-bugs">Reporting bugs</a></li>
<li><a href="#packaging-pyradio">Packaging PyRadio</a></li>
Expand Down Expand Up @@ -2060,6 +2063,9 @@ <h2 id="remote-control-server">Remote Control Server <span style="padding-left:
<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>
<p>For more information, please refer to <a href="server.html">the relevant page</a>.</p>
<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>
<h3 id="remote-control-client">Remote Control Client</h3>
<p><strong>PyRadio</strong> comes with its own client, which will make it easier to communicate with the <strong>Remote Control Server</strong>.</p>
<p>For more information, please refer to <a href="client.html">the relevant page</a>.</p>
<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>
<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>
<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>
Expand Down
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ To ensure the correct operation, please take these actions:
* [Session unlocking](#session-unlocking)
* [Update notification](#update-notification)
* [Remote Control Server](#remote-control-server)
* [Remote Control Client](#remote-control-client)
* [Debug mode](#debug-mode)
* [Reporting bugs](#reporting-bugs)
* [Packaging PyRadio](#packaging-pyradio)
Expand Down Expand Up @@ -1149,6 +1150,12 @@ For more information, please refer to [the relevant page](server.md).

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

### Remote Control Client

**PyRadio** comes with its own client, which will make it easier to communicate with the **Remote Control Server**.

For more information, please refer to [the relevant page](client.md).

## Debug mode

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*.
Expand Down
85 changes: 85 additions & 0 deletions docs/pyradio-client.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.TH pyradio-client 1 "May 2024" pyradio

.SH Name
.PP
pyradio-client \- a Remote Control Client for PyRadio

.SH \fBRemote\ Control\ Client
.P
\f[B]PyRadio\f[R] comes with a client to be used in conjunction with the
\f[B]Remote Control Server\f[R] provided by the program, using the
server\[cq]s text command set.
.PP
The \f[B]client\f[R] is created with maximum ease in mind; the user does
not even have to provide the IP and PORT.
.SH Command line parameters
The following is the output of the \[lq]\f[B]pyradio-client -h\f[R]\[rq]
command:
.P
\fIUsage: \fBpyradio-client\fI [\fB-h\fI] [\fB--address\fI] [\fB-s\fI SERVER_AND_PORT] [\fB-r\fI]
[\fB-t\fI TIMEOUT] [command]

PyRadio Remote Control Client

General options:
\fB-h\fI, \fB--help\fI Show this help message and exit
\fB--address\fI List available servers

Server Parameters:
\fB-s\fI SERVER_AND_PORT, \fB--server_and_port\fI SERVER_AND_PORT
Set the servers\[aq]s IP and PORT (format: IP:PORT)
\fB-r\fI, \fB--reverse-detection\fI
Reverse server detection (when no server IP and PORT
specified); detect headless server last, instead of
headless server first
\fB-t\fI TIMEOUT, \fB--timeout\fI TIMEOUT
Set the timeout (default = 1.0)
command The command to send to the server
.EE
.SH How it works
The client will auto-detect the \f[B]PyRadio Servers\f[R] running on the
system, when the \[lq]\f[I]-s\f[R]\[rq] command line parameter is not
used.
.PP
The auto-detection functionality is based on parsing the
\[lq]\f[I]server files\f[R]\[rq] (residing in the STATE directory).
.PP
If both a \f[B]headless\f[R] and a \f[B]normal\f[R] instance of
\f[B]PyRadio\f[R] are detected, the \f[B]headless\f[R] server will be
used to send the requested command, unless the \[lq]\f[I]-r\f[R]\[rq]
(\[lq]\f[I]\[en]reverse-detection\f[R]\[rq]) command line parameter is
used.
.IP \fBNote:
A \f[B]normal\f[R] server is a server started by a \f[B]PyRadio\f[R]
instance which is executed on a real terminal, without the
\[lq]\f[I]\[en]\[en]headless\f[R]\[rq] command line parameter.
.PP
A list of available commands will be displayed when no command has been
specified.
.PP
A list of detected servers (and their address) can be obtained
using the command:
.IP
.EX
\fI$ pyradio-client --addr
PyRadio Remote Control Server
Headless server: 127.0.0.1:11111
Server: 127.0.0.1:9998
.EE
.PP
Then, the \f[B]address\f[R] reported can be used to contact a specific
server:
.IP
.EX
\fIpyradio-client -s 127.0.0.1:9998 i
.EE
.PP
The previous command will get the info page of the \f[B]normal\f[R]
instance of a server.

.SH See also

pyradio_server(1)

pyradio(1)
2 changes: 2 additions & 0 deletions docs/pyradio.1
Original file line number Diff line number Diff line change
Expand Up @@ -1977,3 +1977,5 @@ RadioBrowser Implementation
Recording stations
.IP \fIpyradio_server(1)
Remote Control Server
.IP \fIpyradio-client(1)
Remote Control Client
3 changes: 3 additions & 0 deletions docs/pyradio_server.1
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,7 @@ Furthermore, using it from a browser, clicking or tapping the corresponding butt

.SH See also

pyradio-client(1)

pyradio(1)

3 changes: 1 addition & 2 deletions pyradio/config
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ enable_notifications = -1
use_station_icon = True

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

0 comments on commit af91878

Please sign in to comment.