From 99509df8d8abf1e7b701a4a09cf170a362f6d878 Mon Sep 17 00:00:00 2001 From: capellancitizen Date: Sun, 9 Mar 2025 21:21:48 -0400 Subject: Mypy type correctness (#3199) --- lib/tartan/palette.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/tartan/palette.py') diff --git a/lib/tartan/palette.py b/lib/tartan/palette.py index d945eb83..25bd2100 100644 --- a/lib/tartan/palette.py +++ b/lib/tartan/palette.py @@ -5,12 +5,14 @@ # Additional credits to: https://github.com/clsn/pyTartan import re -from typing import List +from typing import TYPE_CHECKING, List, cast import wx from inkex import Color from .colors import string_to_color +if TYPE_CHECKING: + from ..gui.tartan.stripe_panel import StripePanel class Palette: @@ -59,7 +61,7 @@ class Palette: stripes = [] for stripe_sizer in outer_sizer.Children: stripe = {'render': 1, 'color': '#000000', 'width': '5'} - stripe_panel = stripe_sizer.GetWindow() + stripe_panel = cast('StripePanel', stripe_sizer.GetWindow()) stripe['render'] = stripe_panel.visibility.Get3StateValue() stripe['color'] = stripe_panel.colorpicker.GetColour().GetAsString(wx.C2S_HTML_SYNTAX) stripe['width'] = stripe_panel.stripe_width.GetValue() -- cgit v1.2.3