]> git.mar77i.info Git - zenbook_gui/commitdiff
make repeatbutton public to ui
authormar77i <mar77i@protonmail.ch>
Fri, 14 Feb 2025 09:03:41 +0000 (10:03 +0100)
committermar77i <mar77i@protonmail.ch>
Fri, 14 Feb 2025 09:03:41 +0000 (10:03 +0100)
13 files changed:
bookpaint.py
bookpaint/bookpaint.py
ui/__init__.py
vectors/__init__.py
vectors/base.py
vectors/circle.py
vectors/polygon.py
vectors/stroke_circle.py
vectors/stroke_circle_segment.py
vectors/stroke_path.py
vectors/stroke_round_line.py
vectors/stroke_square_line.py
zenbook_conf.py

index bfdd01aba283c32627e9ed7221fac6b636330c0f..cba34b71b7f91d154e2affd86fa0cfbbe588b3a5 100755 (executable)
@@ -10,6 +10,7 @@ sys.path.append(str(Path(__file__).parent))
 from bookpaint.bookpaint import BookPaint
 
 with redirect_stdout(StringIO()):
+    # ruff: noqa: F401
     import pygame  # type: ignore
 
 BookPaint().run()
index 3fd7307a3d3e5ba42e5e7388b7c260c1af4efa14..aba202b4fdec2e7125cc3d7367c41cf38eaf9bed 100644 (file)
@@ -4,7 +4,7 @@ from pathlib import Path
 
 import pygame
 
-from ui.ui import Button, Child, FPSWidget, Label, Modal, RepeatButton, Root
+from ui import Button, Child, FPSWidget, Label, Modal, RepeatButton, Root
 from layout.layout import BarLayout
 
 from .draw_ui import DrawImage
index 1f631944d39f5ff14f8120efda1ed55ce64e316c..d1186595fc2c32f593374ac797ea653aaf8db120 100644 (file)
@@ -13,7 +13,30 @@ from .rect import Rect
 from .root import Root
 from .scroll import Scroll
 from .slider import Slider
-from .spinner import Spinner
+from .spinner import RepeatButton, Spinner
 from .switch import Switch
 from .tab_bar import TabBar
 from .text_input import TextInput
+
+__all__ = [
+    "Button",
+    "Child",
+    "DropDown",
+    "EventMethodDispatcher",
+    "FPSWidget",
+    "Icon",
+    "IconButton",
+    "Label",
+    "MessageBox",
+    "Modal",
+    "Parent",
+    "Rect",
+    "RepeatButton",
+    "Root",
+    "Scroll",
+    "Slider",
+    "Spinner",
+    "Switch",
+    "TabBar",
+    "TextInput",
+]
index 3d850b7b3b62ef57a7f11298254232a54c7f5d5f..e5475545adad625377987df4a72c7dc0e0f9b9cf 100644 (file)
@@ -8,3 +8,17 @@ from .stroke_circle_segment import StrokeCircleSegment
 from .stroke_path import StrokePath
 from .stroke_round_line import StrokeRoundLine
 from .stroke_square_line import StrokeSquareLine
+
+__all__ = [
+    "Shape",
+    "Shapes",
+    "Circle",
+    "Ellipse",
+    "Polygon",
+    "Rect",
+    "StrokeCircle",
+    "StrokeCircleSegment",
+    "StrokePath",
+    "StrokeRoundLine",
+    "StrokeSquareLine",
+]
index 5d4ccf812c6c8fdfd4c7b5070b3da58994c28802..637ac5d9256d0a0d794db25a40c15d4b6ec39d99 100644 (file)
@@ -11,7 +11,7 @@ class Shapes(Shape):
         self.shapes = list(shapes)
 
     def fit(self, pos, unit):
-        if type(self) != Shapes:
+        if type(self) is not Shapes:
             raise NotImplementedError
         return Shapes([s.fit(pos, unit) for s in self.shapes])
 
index e04b4a9cbb38213783ae7fb0a1abf6a7e11ba8fa..7b4eb331d64e6ce03c2051d95398e6dc723f3805 100644 (file)
@@ -1,3 +1,5 @@
+import pygame
+
 from .base import Shape
 from .ellipse import Ellipse
 
@@ -8,7 +10,7 @@ class Circle(Shape):
         self.radius = radius
 
     def fit(self, pos, unit):
-        if type(self) != Circle:
+        if type(self) is not Circle:
             raise NotImplementedError
         if unit[0] == unit[1]:
             return Circle(
index a4b747b26541907277ce5d1b11e3906212034414..0e6a785db900a224f2bbc2bbeec75f070a93dcf2 100644 (file)
@@ -8,7 +8,7 @@ class Polygon(Shape):
         self.points = list(points)
 
     def fit(self, pos, unit):
-        if type(self) != Polygon:
+        if type(self) is not Polygon:
             raise NotImplementedError
         return Polygon(
             [
index fdb12a9370fc3c70a3e0f7d88b3c9621fe9b0f5f..c17e214393e3cc9e2a5086f7b21abc65cf10b1f6 100644 (file)
@@ -22,7 +22,7 @@ class StrokeCircle(StrokePath):
         ]
 
     def fit(self, pos, unit):
-        if type(self) != StrokeCircle:
+        if type(self) is not StrokeCircle:
             raise NotImplementedError
         return StrokeCircle(
             (pos[0] + self.center[0] * unit[0], pos[1] + self.center[1] * unit[1]),
index d3eddd1b2b052270f78429e739aa23860b603527..bdf0558774fc709177812a9a00130767902a0123 100644 (file)
@@ -33,7 +33,7 @@ class StrokeCircleSegment(StrokeCircle):
             yield start_angle + a
 
     def fit(self, pos, unit):
-        if type(self) != StrokeCircleSegment:
+        if type(self) is not StrokeCircleSegment:
             raise NotImplementedError
         return StrokeCircleSegment(
             (pos[0] + self.center[0] * unit[0], pos[1] + self.center[1] * unit[1]),
index 6ea9e809718c7726244da260fe93f7dfae26cf5b..c9a51794bb03f787ee2f778425fe3c5a94c4af6f 100644 (file)
@@ -25,7 +25,7 @@ class StrokePath:
             old = new
 
     def fit(self, pos, unit):
-        if type(self) != StrokePath:
+        if type(self) is not StrokePath:
             raise NotImplementedError
         return StrokePath(
             [
index df3e40a92cd3a4ded03dd8cfd6856d5e603a2133..eea860f5ba1c39a7248e1a80ae26011c25a27ff0 100644 (file)
@@ -56,7 +56,7 @@ class StrokeRoundLine(Polygon):
         return ceil(pi / acos(1 - threshold / radius))
 
     def fit(self, pos, unit):
-        if type(self) != StrokeRoundLine:
+        if type(self) is not StrokeRoundLine:
             raise NotImplementedError
         return StrokeRoundLine(
             (pos[0] + self.p1[0] * unit[0], pos[1] + self.p1[1] * unit[1]),
index 975f0b879262e8a40c58af54ddaf5b70efab9f09..e45050f2c3e79bb18bf10da40016983282e84feb 100644 (file)
@@ -34,7 +34,7 @@ class StrokeSquareLine(Polygon):
         ]
 
     def fit(self, pos, unit):
-        if type(self) != StrokeSquareLine:
+        if type(self) is not StrokeSquareLine:
             raise NotImplementedError
         return StrokeSquareLine(
             (pos[0] + self.p1[0] * unit[0], pos[1] + self.p1[1] * unit[1]),
index fd44ccb985255086ef3cb6caef708d004597447b..0ed472d51db16c3d2e3b6903802393a9c30fad05 100755 (executable)
@@ -10,6 +10,7 @@ sys.path.append(str(Path(__file__).parent))
 from zenbook_conf.zenbook_conf import ZenbookConf
 
 with redirect_stdout(StringIO()):
+    # ruff: noqa: F401
     import pygame  # type: ignore
 
 ZenbookConf().run()