From 8314d1ca1651ea33c8179a67843150bb12e10c4c Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 31 May 2022 12:03:56 -0700 Subject: [PATCH] Update to fstrings --- adafruit_shell.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adafruit_shell.py b/adafruit_shell.py index c90149c..fea0596 100644 --- a/adafruit_shell.py +++ b/adafruit_shell.py @@ -125,7 +125,7 @@ class Shell: if message is None: self.error("Exiting due to error") else: - self.error("Exiting due to error: {}".format(message)) + self.error(f"Exiting due to error: {message}") sys.exit(1) def error(self, message): @@ -258,7 +258,7 @@ class Shell: """ location = self.path(location) return self.run_command( - "grep {} {}".format(search_term, location), suppress_message=True + f"grep {search_term} {location}", suppress_message=True ) @staticmethod @@ -385,7 +385,7 @@ class Shell: """ if not self.is_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) def write_text_file(self, path, content, append=True): @@ -516,7 +516,7 @@ class Shell: def check_kernel_update_reboot_required(self): """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( "OS has not been rebooted since last kernel update. " "Please reboot and re-run the script."