From ebd4d61f5ffda8a05f8f9f52bea8fe95d6ae6d88 Mon Sep 17 00:00:00 2001 From: scito Date: Sat, 31 Dec 2022 19:06:57 +0100 Subject: [PATCH] try workaround for Python 3.7: must use () for assignments --- src/extract_otp_secrets.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extract_otp_secrets.py b/src/extract_otp_secrets.py index 46c3f7e..a2766a7 100644 --- a/src/extract_otp_secrets.py +++ b/src/extract_otp_secrets.py @@ -91,17 +91,17 @@ Exception: {e}""") FONT_THICKNESS: Final[int] = 1 FONT_LINE_STYLE: Final[int] = cv2.LINE_AA RECT_THICKNESS: Final[int] = 5 - # PYTHON <= 3.7: do not use Types in Final + # PYTHON <= 3.7: must use () for assignments # START_POS_TEXT: Final[Point] = 5, 20 # NORMAL_COLOR: Final[ColorBGR] = 255, 0, 255 # SUCCESS_COLOR: Final[ColorBGR] = 0, 255, 0 # FAILURE_COLOR: Final[ColorBGR] = 0, 0, 255 # FONT_DY: Final[Tuple[int, int]] = 0, cv2.getTextSize("M", FONT, FONT_SCALE, FONT_THICKNESS)[0][1] + 5 - START_POS_TEXT: Tuple[int, int] = 5, 20 - NORMAL_COLOR: Tuple[int, int, int] = 255, 0, 255 - SUCCESS_COLOR: Tuple[int, int, int] = 0, 255, 0 - FAILURE_COLOR: Tuple[int, int, int] = 0, 0, 255 - FONT_DY: Tuple[int, int] = 0, cv2.getTextSize("M", FONT, FONT_SCALE, FONT_THICKNESS)[0][1] + 5 + START_POS_TEXT: Final[Tuple[Point]] = (5, 20) + NORMAL_COLOR: Final[Tuple[ColorBGR]] = (255, 0, 255) + SUCCESS_COLOR: Final[Tuple[ColorBGR]] = (0, 255, 0) + FAILURE_COLOR: Final[Tuple[ColorBGR]] = (0, 0, 255) + FONT_DY: Final[Tuple[int, int]] = (0, cv2.getTextSize("M", FONT, FONT_SCALE, FONT_THICKNESS)[0][1] + 5) qreader_available = True except ImportError: