Docs clean up part 1

Big push on getting the docs cleaned up before 1.0. Proper wrapping of
everything so it's decently viewable from the command line (or as
decently viewable as markdown can be - the tables will never look great
from the command line).

Only one code change in this PR: rename bouncetime to bounce_time
(everything else is PEP-8, so this probably should be too) and change
its units to seconds from milliseconds (again, all other durations in
the library are in seconds, so it feels inconsistent that this one
isn't; for the sake of those who won't read the docs - which is most
people - I figure consistency helps with guessing!).
This commit is contained in:
Dave Jones
2015-10-03 16:24:12 +01:00
parent 3a4d3d4deb
commit 7429c03117
9 changed files with 304 additions and 76 deletions

View File

@@ -42,20 +42,20 @@ class LEDBoard(object):
"""
Make all the LEDs turn on and off repeatedly.
on_time: 1
on_time: `1`
Number of seconds to be on
off_time: 1
off_time: `1`
Number of seconds to be off
n: None
n: `None`
Number of times to blink; None means forever
background: True
If True, start a background thread to continue blinking and return
immediately. If False, only return when the blink is finished
(warning: the default value of n will result in this method never
returning).
background: `True`
If `True`, start a background thread to continue blinking and
return immediately. If `False`, only return when the blink is
finished (warning: the default value of `n` will result in this
method never returning).
"""
for led in self._leds:
led.blink(on_time, off_time, n, background)
@@ -74,13 +74,13 @@ class TrafficLights(LEDBoard):
"""
Generic Traffic Lights set.
red: None
red: `None`
Red LED pin
amber: None
amber: `None`
Amber LED pin
green: None
green: `None`
Green LED pin
"""
def __init__(self, red=None, amber=None, green=None):
@@ -144,20 +144,20 @@ class FishDish(TrafficLights):
"""
Make all the board's components turn on and off repeatedly.
on_time: 1
on_time: `1`
Number of seconds to be on
off_time: 1
off_time: `1`
Number of seconds to be off
n: None
n: `None`
Number of times to blink; None means forever
background: True
If True, start a background thread to continue blinking and return
immediately. If False, only return when the blink is finished
(warning: the default value of n will result in this method never
returning).
background: `True`
If `True`, start a background thread to continue blinking and
return immediately. If `False`, only return when the blink is
finished (warning: the default value of `n` will result in this
method never returning).
"""
for thing in self._all:
led.blink(on_time, off_time, n, background)
@@ -185,20 +185,20 @@ class FishDish(TrafficLights):
"""
Make all the board's LEDs turn on and off repeatedly.
on_time: 1
on_time: `1`
Number of seconds to be on
off_time: 1
off_time: `1`
Number of seconds to be off
n: None
n: `None`
Number of times to blink; None means forever
background: True
If True, start a background thread to continue blinking and return
immediately. If False, only return when the blink is finished
(warning: the default value of n will result in this method never
returning).
background: `True`
If `True`, start a background thread to continue blinking and
return immediately. If `False`, only return when the blink is
finished (warning: the default value of `n` will result in this
method never returning).
"""
super(FishDish, self).blink(on_time, off_time, n, background)
@@ -234,7 +234,7 @@ class Robot(object):
Make the robot turn left. If seconds given, stop after given number of
seconds.
seconds: None
seconds: `None`
Number of seconds to turn left for
"""
self._left.forward()
@@ -249,7 +249,7 @@ class Robot(object):
Make the robot turn right. If seconds given, stop after given number of
seconds.
seconds: None
seconds: `None`
Number of seconds to turn right for
"""
self._right.forward()
@@ -261,9 +261,10 @@ class Robot(object):
def forward(self, seconds=None):
"""
Drive the robot forward. If seconds given, stop after given number of seconds.
Drive the robot forward. If seconds given, stop after given number of
seconds.
seconds: None
seconds: `None`
Number of seconds to drive forward for
"""
self._left.forward()
@@ -275,9 +276,10 @@ class Robot(object):
def backward(self, seconds=None):
"""
Drive the robot backward. If seconds given, stop after given number of seconds.
Drive the robot backward. If seconds given, stop after given number of
seconds.
seconds: None
seconds: `None`
Number of seconds to drive backward for
"""
self._left.backward()