PLG: SNMPDSC typo

This commit is contained in:
jokob-sk
2025-10-31 20:24:13 +11:00
parent 2f7d9a02ae
commit 78ab0fbd2d
4 changed files with 36 additions and 26 deletions

View File

@@ -768,11 +768,19 @@ def collect_lang_strings(json, pref, stringSqlParams):
return stringSqlParams
#-------------------------------------------------------------------------------
def checkNewVersion():
mylog('debug', [f"[Version check] Checking if new version available"])
# Get the value from the buildtimestamp.txt and initialize it if missing
def getBuildTimeStamp():
"""
Retrieves the build timestamp from 'front/buildtimestamp.txt' within the
application directory.
newVersion = False
If the file does not exist, it is created and initialized with the value '0'.
Returns:
int: The integer value of the build timestamp read from the file.
Returns 0 if the file is empty or just initialized.
"""
buildTimestamp = 0
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
# Ensure file exists, initialize if missing
@@ -784,6 +792,16 @@ def checkNewVersion():
with open(build_timestamp_path, 'r') as f:
buildTimestamp = int(f.read().strip() or 0)
return buildTimestamp
#-------------------------------------------------------------------------------
def checkNewVersion():
mylog('debug', [f"[Version check] Checking if new version available"])
newVersion = False
buildTimestamp = getBuildTimeStamp()
try:
response = requests.get(
"https://api.github.com/repos/jokob-sk/NetAlertX/releases",