Skip to content

Commit 1339ec6

Browse files
committed
version 0.9.2.7
1 parent b62f895 commit 1339ec6

21 files changed

+67
-49
lines changed

Changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2023-06-05 s-n-g
2+
* version 0.9.2.7
3+
* fixing a couple of install.py potential crashes
4+
* fixing a theme download potential crash
5+
* theme transparency will always be honored, in contrast
6+
to global (config transparency setting)
7+
18
2023-05-08 s-n-g
29
* version 0.9.2.6
310
* using pipx for installation on "externally-managed"

README.html

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
206206
<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></span></h2>
207207
<pre style="height: 200px;">
208208

209+
2023-06-05 s-n-g
210+
* version 0.9.2.7
211+
* fixing a couple of install.py potential crashes
212+
* fixing a theme download potential crash
213+
* theme transparency will always be honored, in contrast
214+
to global (config transparency setting)
215+
209216
2023-05-08 s-n-g
210217
* version 0.9.2.6
211218
* using pipx for installation on "externally-managed"
@@ -1637,9 +1644,9 @@ <h2 id="pyradio-themes">PyRadio Themes <span style="padding-left: 10px;"><sup st
16371644

16381645
# Theme Transparency
16391646
# Values are:
1640-
# 0: No transparency (default)
1647+
# 0: No transparency
16411648
# 1: Theme is transparent
1642-
# 2: Obey config setting
1649+
# 2: Obey config setting (default)
16431650
transparency 0</pre>
16441651
<p>Pressing “<strong>t</strong>” will bring up the <em>Theme selection window</em>, which can be used to activate a theme and set the default one.</p>
16451652
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> If the theme selected in the “<em>Theme selection window</em>”, (or requested using the “<strong>-t</strong>” command line option), is in any way invalid, or is of the old format, <strong>PyRadio</strong> will fall-back to the “<strong>dark</strong>” theme and will display a relevant message.</p>
@@ -1734,12 +1741,14 @@ <h3 id="using-transparency">Using transparency</h3>
17341741
<p>For <strong>PyRadio</strong>, transparency means that a theme’s background actually disappears, effectively making it to display whatever is on the terminal (color/picture/transparency). The visual result depends on terminal settings and whether a compositor is running.</p>
17351742
<p>Not all themes look good when transparency is ON, so themes can now declare whether they want to use transparency or not. This is the “<strong>transparency</strong>” variable of the theme, which can have these values:</p>
17361743
<ul>
1737-
<li>0 means that the theme looks better with no transparency (default)</li>
1738-
<li>1 means that the theme looks better when transparency in ON</li>
1739-
<li>2 means that the theme looks good either way, and the global transparency setting (defined in <strong>PyRadio</strong> config file) can be used.</li>
1744+
<li>0 means that the theme will be opaque (no transparency)</li>
1745+
<li>1 means that the theme will be transparent</li>
1746+
<li>2 means that the theme looks good either way (the default), and the global transparency setting value (defined in <strong>PyRadio</strong> config file) will be used.</li>
17401747
</ul>
1741-
<p>Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using “<strong>T</strong>” (capital “<strong>t</strong>”).</p>
1742-
<p>When the “<em>Theme selection window</em>” is visible, a “<strong>[T]</strong>” string displayed at its bottom right corner will indicate that transparency is <em>on</em>.</p>
1748+
<p>Please note that this behavior has changed since <strong>v. 0.9.2.7</strong>: theme transparency will always be honored, regardless of the global config value.</p>
1749+
<p>This means that a theme which is set to be transparent (by its creator) will always be transparent, no matter if the global transparency is on or off. Similarly, if a theme is set to be opaque, it will be so regardless of the global transparency value.</p>
1750+
<p>The only case when global transparency will come into play is when the theme does not care about it (theme transparency set to 2 - Obey config setting).</p>
1751+
<p>When the “<em>Theme selection window</em>” is visible, a “<strong>[T]</strong>” string displayed at its bottom right corner will indicate that global transparency is “<em>ON</em>”.</p>
17431752
<h3 id="updating-themes-automatically">Updating themes automatically</h3>
17441753
<p>Terminal users have been using all kind of software to change / update / adapt their terminal colors and palettes, such as <a target="_blank" href="https://github.com/chriskempson/base16">bASE16</a>, <a target="_blank" href="https://github.com/dylanaraps/pywal">pywal</a>, <a target="_blank" href="https://github.com/deviantfero/wpgtk">wpgtk</a>, <a target="_blank" href="https://github.com/lemnos/theme.sh">theme.sh</a>, to name a few.</p>
17451754
<p><strong>PyRadio</strong> is now able to “watch” a given theme for changes and update its colors whenever the theme changes.</p>

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,9 @@ Messages Border #a3b367
939939
940940
# Theme Transparency
941941
# Values are:
942-
# 0: No transparency (default)
942+
# 0: No transparency
943943
# 1: Theme is transparent
944-
# 2: Obey config setting
944+
# 2: Obey config setting (default)
945945
transparency 0
946946
```
947947

@@ -1096,13 +1096,17 @@ For **PyRadio**, transparency means that a theme's background actually disappear
10961096

10971097
Not all themes look good when transparency is ON, so themes can now declare whether they want to use transparency or not. This is the "**transparency**" variable of the theme, which can have these values:
10981098

1099-
- 0 means that the theme looks better with no transparency (default)
1100-
- 1 means that the theme looks better when transparency in ON
1101-
- 2 means that the theme looks good either way, and the global transparency setting (defined in **PyRadio** config file) can be used.
1099+
- 0 means that the theme will be opaque (no transparency)
1100+
- 1 means that the theme will be transparent
1101+
- 2 means that the theme looks good either way (the default), and the global transparency setting value (defined in **PyRadio** config file) will be used.
11021102

1103-
Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using "**T**" (capital "**t**").
1103+
Please note that this behavior has changed since **v. 0.9.2.7**: theme transparency will always be honored, regardless of the global config value.
11041104

1105-
When the "*Theme selection window*" is visible, a "**[T]**" string displayed at its bottom right corner will indicate that transparency is *on*.
1105+
This means that a theme which is set to be transparent (by its creator) will always be transparent, no matter if the global transparency is on or off. Similarly, if a theme is set to be opaque, it will be so regardless of the global transparency value.
1106+
1107+
The only case when global transparency will come into play is when the theme does not care about it (theme transparency set to 2 - Obey config setting).
1108+
1109+
When the "*Theme selection window*" is visible, a "**[T]**" string displayed at its bottom right corner will indicate that global transparency is "*ON*".
11061110

11071111
### Updating themes automatically
11081112

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyradio"
3-
version = "0.9.2.6"
3+
version = "0.9.2.7"
44
authors = [
55
{ name="Ben Dowling", email="[email protected]" },
66
{ name="Spiros Georgaras", email="[email protected]" },

pyradio.1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\" Copyright (C) 2018-2023 Spiros Georgaras <[email protected]>
33
.\" This manual is freely distributable under the terms of the GPL.
44
.\"
5-
.TH pyradio 1 "May 2023" pyradio
5+
.TH pyradio 1 "June 2023" pyradio
66

77
.SH Name
88
.PP
@@ -1263,19 +1263,23 @@ Not all themes look good when transparency is ON, so themes can now declare whet
12631263

12641264
.RS 5
12651265
.IP \fI0\fR 3
1266-
means that the theme looks better with no transparency (default)
1266+
means that the theme will be opaque (no transparency).
12671267

12681268
.IP \fI1\fR 3
1269-
means that the theme looks better when transparency in ON
1269+
means that the theme will be transparent.
12701270

12711271
.IP \fI2\fR 3
1272-
means that the theme looks good either way, and the global transparency setting (defined in \fBpyrRadio\fR config file) can be used.
1272+
- 2 means that the theme looks good either way (the default), and the global transparency setting value (defined in \fBpyradio\fR config file) will be used.
12731273

12741274
.RE
12751275
.PP
1276-
Please notice that this is just a hint; themes will obey the rules above, but transparency can still be toggled using "\fIT\fR" (capital "\fIt\fR").
1276+
Please note that this behavior has changed since \fBv. 0.9.2.7\fR: theme transparency will always be honored, regardless of the global config value.
12771277

1278-
When the \fITheme selection window\fR is visible, a "\fI[T]\fR" string displayed at its bottom right corner will indicate that transparency is \fIon\fR.
1278+
This means that a theme which is set to be transparent (by its creator) will always be transparent, no matter if the global transparency is on or off. Similarly, if a theme is set to be opaque, it will be so regardless of the global transparency value.
1279+
1280+
The only case when global transparency will come into play is when the theme does not care about it (theme transparency set to \fI2 \fR- \fIObey config setting\fR).
1281+
1282+
When the \fITheme selection window\fR is visible, a "\fI[T]\fR" string displayed at its bottom right corner will indicate that global transparency is \fIon\fR.
12791283
.RE
12801284

12811285
\fBUpdating themes automatically\fR

pyradio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 9, 2, 6)
3+
version_info = (0, 9, 2, 7)
44

55
# Set it to True if new stations have been
66
# added to the package's stations.csv

pyradio/config_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class PyRadioConfigWindow(object):
7878
'This is the equivalent to the -t , --theme command line option.', '|',
7979
'If a theme uses more colors than those supported by the terminal in use, the "dark" theme will be used instead (but the "light" theme will be used, if the "light_16colors" theme was requested but not supported).',
8080
'|', 'Default value = dark'])
81-
_help_text.append(['If False, theme colors will be used.', '|',
81+
_help_text.append(['This option will work when a theme\'s transparency value is set to 2 (Obey config setting), the default. Otherwise, it\'s up to the theme to handle transparency.', '|', 'If False, theme colors will be used.', '|',
8282
"If True and a compositor is running, the stations' window background will be transparent.", '|', "If True and a compositor is not running, the terminal's background color will be used.", '|', 'Default value: False'])
8383
_help_text.append(['Pyradio can calculate and use an alternative color for secondary windows.', '|', 'This option will determine if this color will be used (value > 0) or not (value = 0), provided that the theme used does not already provide it.', '|', 'The value of this option is actually the factor to darken or lighten the main (stations) background color.', '|', 'You can get more info on this at https://github.com/coderholic/pyradio#secondary-windows-background', '|', 'Valid Values: 0-0.2', 'Default value: 0'])
8484
_help_text.append(None)

pyradio/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
''' This is PyRadio version this
1616
install.py was released for
1717
'''
18-
PyRadioInstallPyReleaseVersion = '0.9.2.6'
18+
PyRadioInstallPyReleaseVersion = '0.9.2.7'
1919

2020
import locale
2121
locale.setlocale(locale.LC_ALL, "")

pyradio/radio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,6 @@ def _show_theme_selector(self, changed_from_config=False):
23632363
self._theme_name,
23642364
self._cnf.theme,
23652365
11, 3, 11, 10, 6, 9,
2366-
self._theme.calculate_transparency(),
23672366
self._cnf.auto_update_theme,
23682367
self._watch_theme_lock
23692368
)

pyradio/themes.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,6 @@ class PyRadioThemeSelector(object):
814814
_max_title_width = 20
815815
_categories = 1
816816

817-
transparent = False
818-
_transparent = False
819-
820817
_showed = False
821818

822819
changed_from_config = False
@@ -827,7 +824,7 @@ def __init__(self, parent, config, theme,
827824
title_color_pair, box_color_pair,
828825
applied_color_pair, normal_color_pair,
829826
cursor_color_pair, applied_cursor_color_pair,
830-
is_transparent, is_watched, a_lock, log_file=''):
827+
is_watched, a_lock, log_file=''):
831828
self.parent = parent
832829
self._cnf = config
833830
self._theme = theme
@@ -839,7 +836,6 @@ def __init__(self, parent, config, theme,
839836
self._applied_cursor_color_pair = applied_cursor_color_pair
840837
self._applied_color_pair = applied_color_pair
841838
self._normal_color_pair = normal_color_pair
842-
self._transparent = is_transparent
843839
self._theme_is_watched = is_watched
844840
self._watch_theme_lock = a_lock
845841
self._watch_theme_lock.acquire()
@@ -1064,12 +1060,11 @@ def getmaxyx(self):
10641060

10651061
@property
10661062
def transparent(self):
1067-
return self._transparent
1063+
return self._cnf.use_transparency
10681064

10691065
@transparent.setter
10701066
def transparent(self, val):
1071-
self._transparent = val
1072-
self.refresh()
1067+
return
10731068

10741069
@property
10751070
def selection(self):
@@ -1176,7 +1171,7 @@ def refresh(self):
11761171
except:
11771172
pass
11781173
''' display transparency indicator '''
1179-
if self._transparent:
1174+
if self._cnf.use_transparency:
11801175
self._win.addstr(self._height-1, self._width - 4, '[T]', curses.color_pair(self._box_color_pair))
11811176
else:
11821177
try:

pyradio/themes/blue-by-boxer.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ Messages Border #FD5902
4141
# 0: No transparency
4242
# 1: Theme is transparent
4343
# 2: Obey config setting (default)
44-
transparency 0
44+
transparency 2

pyradio/themes/catppuccin-frappe.pyradio-theme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ PyRadio URL #CA9EE6
3333
# Please refer to the following link for more info
3434
# https://github.com/coderholic/pyradio#secondary-windows-background
3535
#
36-
Messages Border #CA9EE6
36+
Messages Border #CA9EE6
3737

3838
# Theme Transparency
3939
# Values are:
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/catppuccin-latte.pyradio-theme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ PyRadio URL #8839EF
3333
# Please refer to the following link for more info
3434
# https://github.com/coderholic/pyradio#secondary-windows-background
3535
#
36-
Messages Border #8839EF
36+
Messages Border #8839EF
3737

3838
# Theme Transparency
3939
# Values are:
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/catppuccin-macchiato.pyradio-theme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ PyRadio URL #C6A0F6
3333
# Please refer to the following link for more info
3434
# https://github.com/coderholic/pyradio#secondary-windows-background
3535
#
36-
Messages Border #C6A0F6
36+
Messages Border #C6A0F6
3737

3838
# Theme Transparency
3939
# Values are:
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/catppuccin-mocha.pyradio-theme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ PyRadio URL #CBA6F7
3333
# Please refer to the following link for more info
3434
# https://github.com/coderholic/pyradio#secondary-windows-background
3535
#
36-
Messages Border #CBA6F7
36+
Messages Border #CBA6F7
3737

3838
# Theme Transparency
3939
# Values are:
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/cupcake_by_edunfelt.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Messages Border #a3b367
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/fairyflossy_by_edunfelt.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Messages Border #9673d3
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/gruvbox_dark_by_sng.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Edit Cursor #ffffff #fb4933
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/gruvbox_light_by_sng.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ Edit Cursor #bdae93 #504945
4141
# 0: No transparency
4242
# 1: Theme is transparent
4343
# 2: Obey config setting (default)
44-
transparency 0
44+
transparency 2

pyradio/themes/minima_by_ben_chile.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Messages Border #1AA085
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

pyradio/themes/pastel_based_by_sng.pyradio-theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Messages Border #8ceb76
4040
# 0: No transparency
4141
# 1: Theme is transparent
4242
# 2: Obey config setting (default)
43-
transparency 0
43+
transparency 2

0 commit comments

Comments
 (0)