From 21416fd55a6cf042047a35f607366529447f6ce2 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Thu, 15 Feb 2024 09:36:28 +0100 Subject: [PATCH] bugfix: optional parameters --- API/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/API/main.py b/API/main.py index c2d9834..14302db 100755 --- a/API/main.py +++ b/API/main.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from deps.samplebase import SampleBase from rgbmatrix import graphics +from typing import Optional from PIL import Image import requests @@ -294,7 +295,7 @@ class Matrix(SampleBase): self.image = Image.open(requests.get(url, stream=True).raw) # display image at position with dimensions in current color - def display_image(self, x: int, y: int, w: int|None = None, h: int|None = None): + def display_image(self, x: int, y: int, w: Optional[int] = None, h: Optional[int] = None): # resize image to specified or max size self.image.resize((w or self.matrix.width, h or self.matrix.height), Image.ANTIALIAS) # set image at position