MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _TurtleImage

Class _TurtleImage

tools/python-3.11.9-amd64/Lib/turtle.py:2482–2510  ·  view source on GitHub ↗

Helper class: Datatype to store Turtle attributes

Source from the content-addressed store, hash-verified

2480
2481
2482class _TurtleImage(object):
2483 """Helper class: Datatype to store Turtle attributes
2484 """
2485
2486 def __init__(self, screen, shapeIndex):
2487 self.screen = screen
2488 self._type = None
2489 self._setshape(shapeIndex)
2490
2491 def _setshape(self, shapeIndex):
2492 screen = self.screen
2493 self.shapeIndex = shapeIndex
2494 if self._type == "polygon" == screen._shapes[shapeIndex]._type:
2495 return
2496 if self._type == "image" == screen._shapes[shapeIndex]._type:
2497 return
2498 if self._type in ["image", "polygon"]:
2499 screen._delete(self._item)
2500 elif self._type == "compound":
2501 for item in self._item:
2502 screen._delete(item)
2503 self._type = screen._shapes[shapeIndex]._type
2504 if self._type == "polygon":
2505 self._item = screen._createpoly()
2506 elif self._type == "image":
2507 self._item = screen._createimage(screen._shapes["blank"]._data)
2508 elif self._type == "compound":
2509 self._item = [screen._createpoly() for item in
2510 screen._shapes[shapeIndex]._data]
2511
2512
2513class RawTurtle(TPen, TNavigator):

Callers 2

__init__Method · 0.85
cloneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected