Skip to content

Commit 8e22fbe

Browse files
committed
Actually fix release notes working by defaulting to full version number checks, bump to 0.4.8.20
1 parent b22e709 commit 8e22fbe

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

scc/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
If SC-Controller is updated while daemon is running, DAEMON_VERSION send by
2929
daemon will differ one one expected by UI and daemon will be forcefully restarted.
3030
"""
31-
DAEMON_VERSION = "0.4.8.19"
31+
DAEMON_VERSION = "0.4.8.20"
3232

3333
HPERIOD = 0.02
3434
LPERIOD = 0.5

scc/gui/app.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,9 +1487,9 @@ def aso(long_name, short_name, description,
14871487

14881488
self.connect('handle-local-options', self.do_local_options)
14891489

1490-
aso("verbose", b"v", "Be verbose")
1491-
aso("debug", b"d", "Be more verbose (debug mode)")
1492-
aso("osd", b"o", "OSD mode (OSD-controllable editor for current profile)")
1490+
aso("verbose", b"v", "Be verbose")
1491+
aso("debug", b"d", "Be more verbose (debug mode)")
1492+
aso("osd", b"o", "OSD mode (OSD-controllable editor for current profile)")
14931493

14941494

14951495
def save_profile_selection(self, path):
@@ -1508,24 +1508,26 @@ def load_profile_selection(self):
15081508
""" Returns name profile from config file or None if there is none saved """
15091509
try:
15101510
return self.config['recent_profiles'][0]
1511-
except:
1511+
except Exception:
15121512
return None
15131513

15141514

15151515
@staticmethod
1516-
def get_release(n=3):
1516+
def get_release(n:int = 4) -> str:
15171517
"""
15181518
Returns current version rounded to max. 'n' numbers.
15191519
( v0.14.1.3 ; n=3 -> v0.14.1 )
15201520
"""
15211521
split = DAEMON_VERSION.split(".")[0:n]
1522-
while split[-1] == "0": split = split[0:len(split) - 1]
1522+
while split[-1] == "0":
1523+
split = split[0:len(split) - 1]
15231524
return ".".join(split)
15241525

15251526

1526-
def release_notes_visible(self):
1527+
def release_notes_visible(self) -> bool:
15271528
""" Returns True if release notes infobox is visible """
1528-
if not self.ribar: return False
1529+
if not self.ribar:
1530+
return False
15291531
riNewRelease = self.builder.get_object('riNewRelease')
15301532
return self.ribar._infobar == riNewRelease
15311533

@@ -1536,7 +1538,7 @@ def check_release_notes(self):
15361538
informing user that they are ready to be displayed.
15371539
"""
15381540
url = App.RELEASE_URL % (App.get_release(),)
1539-
log.debug("Loading release notes from '%s'", url)
1541+
log.debug(f"Loading release notes from '{url}'")
15401542
f = Gio.File.new_for_uri(url)
15411543
buffer = b""
15421544

@@ -1549,7 +1551,7 @@ def stream_ready(stream, task, buffer):
15491551
else:
15501552
self.on_got_release_notes(buffer.decode("utf-8"))
15511553
except Exception as e:
1552-
log.warning("Failed to read release notes")
1554+
log.warning(f"Failed to read release notes at {url}, maybe your internet connection is down?")
15531555
log.exception(e)
15541556
return
15551557

@@ -1559,7 +1561,7 @@ def http_ready(f, task, buffer):
15591561
assert stream
15601562
stream.read_bytes_async(102400, 0, None, stream_ready, buffer)
15611563
except Exception as e:
1562-
log.warning("Failed to read release notes, maybe your internet connection is down?")
1564+
log.warning(f"Failed to read release notes at {url}, maybe your internet connection is down?")
15631565
# log.exception(f"Following Traceback error is not fatal and can be ignored: {e}")
15641566
return
15651567

0 commit comments

Comments
 (0)