(self, type_, data=None)
| 869 | an image or a list constructed using the addcomponent method. |
| 870 | """ |
| 871 | def __init__(self, type_, data=None): |
| 872 | self._type = type_ |
| 873 | if type_ == "polygon": |
| 874 | if isinstance(data, list): |
| 875 | data = tuple(data) |
| 876 | elif type_ == "image": |
| 877 | assert(isinstance(data, TK.PhotoImage)) |
| 878 | elif type_ == "compound": |
| 879 | data = [] |
| 880 | else: |
| 881 | raise TurtleGraphicsError("There is no shape type %s" % type_) |
| 882 | self._data = data |
| 883 | |
| 884 | def addcomponent(self, poly, fill, outline=None): |
| 885 | """Add component to a shape of type compound. |
nothing calls this directly
no test coverage detected