from bookpaint.bookpaint import BookPaint
with redirect_stdout(StringIO()):
+ # ruff: noqa: F401
import pygame # type: ignore
BookPaint().run()
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
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",
+]
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",
+]
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])
+import pygame
+
from .base import Shape
from .ellipse import Ellipse
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(
self.points = list(points)
def fit(self, pos, unit):
- if type(self) != Polygon:
+ if type(self) is not Polygon:
raise NotImplementedError
return Polygon(
[
]
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]),
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]),
old = new
def fit(self, pos, unit):
- if type(self) != StrokePath:
+ if type(self) is not StrokePath:
raise NotImplementedError
return StrokePath(
[
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]),
]
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]),
from zenbook_conf.zenbook_conf import ZenbookConf
with redirect_stdout(StringIO()):
+ # ruff: noqa: F401
import pygame # type: ignore
ZenbookConf().run()