Skip to content

Commit

Permalink
Beautify the version string before display, not at the point of const…
Browse files Browse the repository at this point in the history
…uction, where it impacts other functions using the version string.

This also reverts commit 4df0802.
  • Loading branch information
WanWizard committed Jan 6, 2025
1 parent 1e11079 commit 2035366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 0 additions & 5 deletions lib/python/Components/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ def getEnigmaVersionString():
enigma_version = enigma.getEnigmaVersionString()
if '-(no branch)' in enigma_version:
enigma_version = enigma_version[:-12]
enigma_version = enigma_version.rsplit("-", enigma_version.count("-") - 2)
if len(enigma_version) == 3:
enigma_version = enigma_version[0] + " (" + enigma_version[2] + "-" + enigma_version[1] + ")"
else:
enigma_version = enigma_version[0] + " (" + enigma_version[1] + ")"
return enigma_version


Expand Down
17 changes: 10 additions & 7 deletions lib/python/Screens/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ def __init__(self, session):
# [WanWizard] Removed until we find a reliable way to determine the installation date
# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

EnigmaVersion = _("Enigma version: ") + about.getEnigmaVersionString()
# get enigma version, and put the release version in front
EnigmaVersion = about.getEnigmaVersionString()
EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
if len(EnigmaVersion) == 3:
EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
else:
EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
EnigmaVersion = _("Enigma version: ") + EnigmaVersion
self["EnigmaVersion"] = StaticText(EnigmaVersion)
AboutText += "\n" + EnigmaVersion + "\n"

Expand Down Expand Up @@ -214,13 +221,9 @@ def __init__(self, session):

self["key_red"] = Button(_("Cancel"))

# get the branch to display from the boxinfo image type and version
# get the branch to display from the Enigma version
try:
# develop-type images have no version but a revision number
if BoxInfo.getItem('imagetype') == "rev":
branch = "?sha=" + BoxInfo.getItem('imageversion')
else:
branch = "?sha=%s-%s" % (BoxInfo.getItem('imagetype'),BoxInfo.getItem('imageversion'))
branch = "?sha=" + about.getEnigmaVersionString().split("(")[1].split(")")[0]
except:
branch = ""
branch_e2plugins = "?sha=python3"
Expand Down

0 comments on commit 2035366

Please sign in to comment.