Update to fstrings
This commit is contained in:
parent
3df36b8185
commit
8314d1ca16
1 changed files with 4 additions and 4 deletions
|
|
@ -125,7 +125,7 @@ class Shell:
|
||||||
if message is None:
|
if message is None:
|
||||||
self.error("Exiting due to error")
|
self.error("Exiting due to error")
|
||||||
else:
|
else:
|
||||||
self.error("Exiting due to error: {}".format(message))
|
self.error(f"Exiting due to error: {message}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def error(self, message):
|
def error(self, message):
|
||||||
|
|
@ -258,7 +258,7 @@ class Shell:
|
||||||
"""
|
"""
|
||||||
location = self.path(location)
|
location = self.path(location)
|
||||||
return self.run_command(
|
return self.run_command(
|
||||||
"grep {} {}".format(search_term, location), suppress_message=True
|
f"grep {search_term} {location}", suppress_message=True
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
@ -385,7 +385,7 @@ class Shell:
|
||||||
"""
|
"""
|
||||||
if not self.is_root():
|
if not self.is_root():
|
||||||
print("Installer must be run as root.")
|
print("Installer must be run as root.")
|
||||||
print("Try 'sudo python3 {}'".format(self.script()))
|
print(f"Try 'sudo python3 {self.script()}'")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def write_text_file(self, path, content, append=True):
|
def write_text_file(self, path, content, append=True):
|
||||||
|
|
@ -516,7 +516,7 @@ class Shell:
|
||||||
|
|
||||||
def check_kernel_update_reboot_required(self):
|
def check_kernel_update_reboot_required(self):
|
||||||
"""Checks if the pi needs to be rebooted since the last kernel update"""
|
"""Checks if the pi needs to be rebooted since the last kernel update"""
|
||||||
if not self.exists("/lib/modules/{}".format(self.release())):
|
if not self.exists(f"/lib/modules/{self.release()}"):
|
||||||
self.error(
|
self.error(
|
||||||
"OS has not been rebooted since last kernel update. "
|
"OS has not been rebooted since last kernel update. "
|
||||||
"Please reboot and re-run the script."
|
"Please reboot and re-run the script."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue