Add __repr__ methods to most objects`

These are closer to what __str__ should be and will likely change in the
future.
This commit is contained in:
Jan Petykiewicz 2020-05-11 20:31:07 -07:00
commit c236fdb81b
10 changed files with 64 additions and 0 deletions

View file

@ -189,3 +189,9 @@ class Ellipse(Shape):
Shape.unlock(self)
self.radii.flags.writeable = True
return self
def __repr__(self) -> str:
rotation = f' r{self.rotation*180/pi:g}' if self.rotation != 0 else ''
dose = f' d{self.dose:g}' if self.dose != 1 else ''
locked = ' L' if self.locked else ''
return f'<Ellipse l{self.layer} o{self.offset} r{self.radii}{rotation}{dose}{locked}>'