From ae0557eae9be052f6b50c74e2ce344cfaee03277 Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Fri, 11 Oct 2024 15:50:13 +0200 Subject: [PATCH] Break up long formatting string --- examples/nmea_publisher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/nmea_publisher.py b/examples/nmea_publisher.py index d8adeec..83c2ef1 100644 --- a/examples/nmea_publisher.py +++ b/examples/nmea_publisher.py @@ -20,7 +20,11 @@ def nmea_sentence(lat: float, lon: float, valid: bool) -> str: now = datetime.datetime.now(datetime.timezone.utc) utc_time = now.strftime("%H%M%S") + f".{now.microsecond // 10000:02d}" - return f"GPGLL,{lat_deg:02d}{lat_min:07.4f},{lat_hemisphere},{lon_deg:03d}{lon_min:07.4f},{lon_hemisphere},{utc_time},{is_valid}" + return ( + f"GPGLL,{lat_deg:02d}{lat_min:07.4f},{lat_hemisphere}," + f"{lon_deg:03d}{lon_min:07.4f},{lon_hemisphere}," + f"{utc_time},{is_valid}" + ) def callback_position_estimate(