from turtle import Turtle from typing import Optional, Collection, Any from controls.device import SynchronyDevice from controls.device import TraitDescriptor from controls.device import ActionDescriptor class TurtleDevice(SynchronyDevice): def open(self): super().open() def close(self): self.turtle.clear() super().close() def trait_descriptors(self) -> Collection[TraitDescriptor]: pass def action_descriptors(self) -> Collection[ActionDescriptor]: pass def __getitem__(self, trait_name: str) -> Optional[Any]: """Return logical state of trait `trait_name`.""" pass def read(self, trait_name: str) -> Any: pass def write(self, trait_name: str, value: Any) -> bool: self.turtle.write() def execute(self, action_name: str, *args, **kwargs): """Execute action `action_name`, using `args` and `kwargs` as action argument.""" pass def invalidate(self, trait_name: str): pass