Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Dec 13, 2023
1 parent 45fc43a commit cc6666e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/predbat/predbat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9620,7 +9620,7 @@ def sanity(self):
self.log("ERROR: Unable to read {} file correctly!".format(filename))
passed = False
if data:
if 'pred_bat' in data:
if "pred_bat" in data:
self.log("Sanity: {} is a valid pred_bat configuration".format(filename))
validPred += 1
if not validPred:
Expand All @@ -9640,10 +9640,10 @@ def sanity(self):
else:
filename = predbat_py[0]
foundVersion = False
with open(filename, 'r') as han:
with open(filename, "r") as han:
for line in han:
if 'THIS_VERSION' in line:
res = re.search("THIS_VERSION\s+=\s+\"([0-9.v]+)\"", line)
if "THIS_VERSION" in line:
res = re.search('THIS_VERSION\s+=\s+"([0-9.v]+)"', line)
if res:
version = res.group(1)
if version != THIS_VERSION:
Expand All @@ -9655,14 +9655,14 @@ def sanity(self):
if not foundVersion:
self.log("WARN: Unable to find THIS_VERSION in Predbat.py file, please check your setup")
passed = False

if passed:
self.log("Sanity check has passed")
else:
self.log("Sanity check FAILED!")
self.record_status("WARN: Sanity startup checked has FAILED, see your logs for details")
return passed

def initialize(self):
"""
Setup the app, called once each time the app starts
Expand Down

0 comments on commit cc6666e

Please sign in to comment.