summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/lock_stitch.py
diff options
context:
space:
mode:
authorcapellancitizen <thecapellancitizen@gmail.com>2025-03-09 21:21:48 -0400
committerGitHub <noreply@github.com>2025-03-09 21:21:48 -0400
commit99509df8d8abf1e7b701a4a09cf170a362f6d878 (patch)
treea461549502fa9f37dc287789b6c7db81dfcd5368 /lib/stitch_plan/lock_stitch.py
parent0d2fc24f25f87562f0755b53dad6204efad1330d (diff)
Mypy type correctness (#3199)
Diffstat (limited to 'lib/stitch_plan/lock_stitch.py')
-rwxr-xr-xlib/stitch_plan/lock_stitch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/stitch_plan/lock_stitch.py b/lib/stitch_plan/lock_stitch.py
index 899aa382..98219154 100755
--- a/lib/stitch_plan/lock_stitch.py
+++ b/lib/stitch_plan/lock_stitch.py
@@ -1,5 +1,6 @@
import re
from math import degrees
+from typing import List, Optional
from inkex import DirectedLineSegment, Path
from shapely.geometry import LineString
@@ -12,16 +13,16 @@ from .stitch import Stitch
class LockStitchDefinition:
- def __init__(self, lock_id=None, name=None, path=None, preview_image=None):
+ def __init__(self, lock_id=None, name=None, path=None, preview_image=None) -> None:
self.id: str = lock_id
self.name: str = name
self._path: str = path
- self.preview_image: str = None
+ self.preview_image: Optional[str] = None
- def __repr__(self):
+ def __repr__(self) -> str:
return "LockStitchDefinition(%s, %s, %s, %s)" % (self.id, self.name, self._path, self.preview_image)
- def stitches(self, stitches, pos, scale):
+ def stitches(self, stitches, pos, scale) -> List[Stitch]:
raise NotImplementedError(f"{self.__class__.__name__} must implement stitches()")