From: Scott Date: Thu, 27 Jan 2022 05:18:33 +0000 (-0800) Subject: Fix missing f's. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=bb3ebebb1a2458fa52b042b35d8e5fbad408ff80;p=python_utils.git Fix missing f's. --- diff --git a/arper.py b/arper.py index a4e8d3e..696bf97 100644 --- a/arper.py +++ b/arper.py @@ -60,7 +60,7 @@ class Arper(persistent.Persistent): self.update_from_arp_scan() self.update_from_arp() if len(self.state) < config.config['arper_min_entries_to_be_valid']: - raise Exception('Arper didn\'t find enough entries; only got {len(self.state)}.') + raise Exception(f'Arper didn\'t find enough entries; only got {len(self.state)}.') def update_from_arp_scan(self): network_spec = site_config.get_config().network diff --git a/base_presence.py b/base_presence.py index 405b743..94c5e2f 100755 --- a/base_presence.py +++ b/base_presence.py @@ -161,7 +161,7 @@ class PresenceDetection(object): if "cabin_" in line: continue if location == Location.CABIN: - logger.debug('Cabin count: {cabin_count}') + logger.debug(f'Cabin count: {cabin_count}') cabin_count += 1 try: (mac, count, ip_name, mfg, ts) = line.split(",") diff --git a/camera_utils.py b/camera_utils.py index 66ef6ac..204a337 100644 --- a/camera_utils.py +++ b/camera_utils.py @@ -150,7 +150,7 @@ def fetch_camera_image_from_rtsp_stream( return out except Exception as e: logger.exception(e) - msg = "Failed to retrieve image via RTSP {stream}, returning None." + msg = f"Failed to retrieve image via RTSP {stream}, returning None." logger.warning(msg) warnings.warn(msg, stacklevel=2) return None diff --git a/logging_utils.py b/logging_utils.py index c04d76d..2b39767 100644 --- a/logging_utils.py +++ b/logging_utils.py @@ -228,7 +228,7 @@ class DynamicPerScopeLoggingLevelFilter(logging.Filter): None ) if not isinstance(numeric_level, int): - raise ValueError('Invalid level: {name}') + raise ValueError(f'Invalid level: {name}') return numeric_level def __init__( @@ -539,7 +539,7 @@ def initialize_logging(logger=None) -> logging.Logger: ) if config.config['lmodule']: logger.debug( - 'Logging dynamic per-module logging enabled (--lmodule={config.config["lmodule"]})' + f'Logging dynamic per-module logging enabled (--lmodule={config.config["lmodule"]})' ) if config.config['logging_captures_prints']: logger.debug('Logging will capture printed data as logger.info messages (--logging_captures_prints)')