summaryrefslogtreecommitdiff
path: root/lib/sew_stack/stitch_layers/mixins/randomization.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2025-08-21 16:10:48 -0400
committerGitHub <noreply@github.com>2025-08-21 16:10:48 -0400
commite9bcdc910a2101c0da2fa379da36e1d1be2fe3f2 (patch)
tree0e47774b5648ff14cf3b67495ea4f361371031a5 /lib/sew_stack/stitch_layers/mixins/randomization.py
parenta71ec6e4599e28dfac45d2df3575976dffbb25d6 (diff)
fix type errors (#3928)
* fix type checking error in overriding path propery * fix type hints in sew stack * enable type checking for tartan * ignore type warnings for dynamic wx module attributes * fix tartan type errors * fix circular import * add type-check and test targets * use Optional instead
Diffstat (limited to 'lib/sew_stack/stitch_layers/mixins/randomization.py')
-rw-r--r--lib/sew_stack/stitch_layers/mixins/randomization.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/sew_stack/stitch_layers/mixins/randomization.py b/lib/sew_stack/stitch_layers/mixins/randomization.py
index 5414731c..009b5042 100644
--- a/lib/sew_stack/stitch_layers/mixins/randomization.py
+++ b/lib/sew_stack/stitch_layers/mixins/randomization.py
@@ -1,17 +1,13 @@
import os
from secrets import randbelow
-from typing import TYPE_CHECKING
import wx.propgrid
+from .protocol import LayerProtocol, with_protocol
from ..stitch_layer_editor import Category, Property
from ....i18n import _
from ....svg import PIXELS_PER_MM
-from ....utils import DotDict, get_resource_dir, prng
-
-if TYPE_CHECKING:
- from ... import SewStack
-
+from ....utils import get_resource_dir, prng
editor_instance = None
@@ -70,10 +66,7 @@ class RandomizationPropertiesMixin:
)
-class RandomizationMixin:
- config: DotDict
- element: "SewStack"
-
+class RandomizationMixin(with_protocol(LayerProtocol)):
@classmethod
def randomization_defaults(cls):
return dict(