Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit e977acd

Browse files
committed
Elaborated docstrings
1 parent bce279a commit e977acd

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/animate.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,16 @@ def distance(self, other: Coord) -> int:
8383

8484
class Direction(Enum):
8585
"""
86-
Defines base directions.
86+
Defines base directions. Can be used to create Coords relative
87+
to a direction.
88+
89+
example::
90+
91+
```
92+
start = Coord(1, 1)
93+
end = start + (Direction.LEFT * 20)
94+
end
95+
>>> Coord(x=-19, y=1)
8796
"""
8897
LEFT = Coord(-1, 0)
8998
RIGHT = Coord(1, 0)
@@ -98,7 +107,19 @@ def __add__(self, other: Direction) -> Coord:
98107

99108

100109
class Animater(tk.Canvas):
110+
"""
111+
Inherits Canvas. Manager for executing animation move commands.
112+
Currently only event base animations are supported.
101113
114+
example::
115+
116+
```
117+
motion = Motion(...)
118+
window = Animator(...)
119+
window.add_motion(motion)
120+
window.add_event('<Enter>')
121+
```
122+
"""
102123
motions = []
103124

104125
def add_event(self, event: tk.EventType):
@@ -195,11 +216,11 @@ def __iter__(self):
195216

196217
def vector(start: Coord, end: Coord, step: int = 60) -> List[Coord]:
197218
"""
198-
Creates a list of all the Coords on a straight line from `start` to `end`.
219+
Creates a list of all the Coords on a straight line from `start` to `end` (inclusive).
199220
200221
param:
201222
start: Coord -- The starting point.
202-
end: Coord -- The ending point.
223+
end: Coord -- The end point.
203224
step: int (optional) -- The desired number of points to include. Defaults to 60.
204225
Actual resulting length may vary.
205226

0 commit comments

Comments
 (0)