From 6a2074b90ba90a884f51ea82c9c86c2e0b1560d4 Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:27:29 +0000 Subject: [PATCH 1/5] Auto update fixes --- apps/predbat/predbat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index af65034ec..e99967d80 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10977,16 +10977,16 @@ def download_predbat_file_from_github(self, filename, new_filename): else: self.log("WARN: Downloading Predbat file failed, URL {}".format(url)) return None - + def download_predbat_version(self, version): """ Download a version of Predbat from GitHub - + Args: version (str): The version of Predbat to download. Returns: - bool: True if the download and update were successful, False otherwise. + bool: True if the download and update were successful, False otherwise. """ tag_split = version.split(" ") this_path = os.path.dirname(__file__) @@ -10999,13 +10999,13 @@ def download_predbat_version(self, version): predbat_code = self.download_predbat_file_from_github(file, os.path.join(this_path, file + "." + tag)) if predbat_code: # Get the list of other files to download by searching for PREDBAT_FILES in predbat.py - files = [] + files = ["predbat.py"] for line in predbat_code: if line.startswith("PREDBAT_FILES"): files = line.split("=")[1].strip() files = files.replace("[", "") files = files.replace("]", "") - files = files.replace('"', "") + files = files.replace("\"", "") files = files.split(",") self.log("Predbat update files are {}".format(files)) break From 74bdaa2e039a36724cad4c11070d25e453160520 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:28:54 +0000 Subject: [PATCH 2/5] [pre-commit.ci lite] apply automatic fixes --- apps/predbat/predbat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index e99967d80..15b3e714a 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10977,16 +10977,16 @@ def download_predbat_file_from_github(self, filename, new_filename): else: self.log("WARN: Downloading Predbat file failed, URL {}".format(url)) return None - + def download_predbat_version(self, version): """ Download a version of Predbat from GitHub - + Args: version (str): The version of Predbat to download. Returns: - bool: True if the download and update were successful, False otherwise. + bool: True if the download and update were successful, False otherwise. """ tag_split = version.split(" ") this_path = os.path.dirname(__file__) @@ -11005,7 +11005,7 @@ def download_predbat_version(self, version): files = line.split("=")[1].strip() files = files.replace("[", "") files = files.replace("]", "") - files = files.replace("\"", "") + files = files.replace('"', "") files = files.split(",") self.log("Predbat update files are {}".format(files)) break From 63c90c1e9a6d2f092dfc423ef83b4f371a5ce0da Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:35:51 +0000 Subject: [PATCH 3/5] Fixes --- apps/predbat/predbat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 15b3e714a..826d7e1ce 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10977,16 +10977,16 @@ def download_predbat_file_from_github(self, filename, new_filename): else: self.log("WARN: Downloading Predbat file failed, URL {}".format(url)) return None - + def download_predbat_version(self, version): """ Download a version of Predbat from GitHub - + Args: version (str): The version of Predbat to download. Returns: - bool: True if the download and update were successful, False otherwise. + bool: True if the download and update were successful, False otherwise. """ tag_split = version.split(" ") this_path = os.path.dirname(__file__) @@ -11000,7 +11000,7 @@ def download_predbat_version(self, version): if predbat_code: # Get the list of other files to download by searching for PREDBAT_FILES in predbat.py files = ["predbat.py"] - for line in predbat_code: + for line in predbat_code.split('\n'): if line.startswith("PREDBAT_FILES"): files = line.split("=")[1].strip() files = files.replace("[", "") @@ -11027,7 +11027,7 @@ def download_predbat_version(self, version): cmd += "mv -f {} {} && ".format(os.path.join(this_path, file + "." + tag), os.path.join(this_path, file)) cmd += "echo 'Update complete'" self.log("Performing update with command: {}".format(cmd)) - os.system(cmd) + #os.system(cmd) return True else: self.log("WARN: Predbat update failed to download Predbat version {}".format(version)) From 611de164e0fa5cebc45fc6cf9d771fe419e935eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:36:36 +0000 Subject: [PATCH 4/5] [pre-commit.ci lite] apply automatic fixes --- apps/predbat/predbat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 826d7e1ce..0a9a0e042 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -10977,16 +10977,16 @@ def download_predbat_file_from_github(self, filename, new_filename): else: self.log("WARN: Downloading Predbat file failed, URL {}".format(url)) return None - + def download_predbat_version(self, version): """ Download a version of Predbat from GitHub - + Args: version (str): The version of Predbat to download. Returns: - bool: True if the download and update were successful, False otherwise. + bool: True if the download and update were successful, False otherwise. """ tag_split = version.split(" ") this_path = os.path.dirname(__file__) @@ -11000,7 +11000,7 @@ def download_predbat_version(self, version): if predbat_code: # Get the list of other files to download by searching for PREDBAT_FILES in predbat.py files = ["predbat.py"] - for line in predbat_code.split('\n'): + for line in predbat_code.split("\n"): if line.startswith("PREDBAT_FILES"): files = line.split("=")[1].strip() files = files.replace("[", "") @@ -11027,7 +11027,7 @@ def download_predbat_version(self, version): cmd += "mv -f {} {} && ".format(os.path.join(this_path, file + "." + tag), os.path.join(this_path, file)) cmd += "echo 'Update complete'" self.log("Performing update with command: {}".format(cmd)) - #os.system(cmd) + # os.system(cmd) return True else: self.log("WARN: Predbat update failed to download Predbat version {}".format(version)) From 937ce57a76cc2030e10eeec492d2d7b5956a5b1e Mon Sep 17 00:00:00 2001 From: Trefor Southwell <48591903+springfall2008@users.noreply.github.com> Date: Sat, 3 Feb 2024 17:36:59 +0000 Subject: [PATCH 5/5] Update predbat.py --- apps/predbat/predbat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/predbat/predbat.py b/apps/predbat/predbat.py index 0a9a0e042..4be8f905e 100644 --- a/apps/predbat/predbat.py +++ b/apps/predbat/predbat.py @@ -11027,7 +11027,7 @@ def download_predbat_version(self, version): cmd += "mv -f {} {} && ".format(os.path.join(this_path, file + "." + tag), os.path.join(this_path, file)) cmd += "echo 'Update complete'" self.log("Performing update with command: {}".format(cmd)) - # os.system(cmd) + os.system(cmd) return True else: self.log("WARN: Predbat update failed to download Predbat version {}".format(version))