Skip to content

Commit e8c0a9c

Browse files
committed
Docs: Fix RST formatting errors in docstrings.
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
1 parent 66a6b11 commit e8c0a9c

File tree

13 files changed

+126
-117
lines changed

13 files changed

+126
-117
lines changed

micropython/drivers/imu/bmi270/bmi270.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
THE SOFTWARE.
2323
24-
Basic example usage:
24+
Basic example usage::
2525
26-
import time
27-
from bmi270 import BMI270
28-
from machine import Pin, SPI, I2C
29-
30-
# Init in I2C mode.
31-
imu = BMI270(I2C(1, scl=Pin(15), sda=Pin(14)))
32-
33-
# Or init in SPI mode.
34-
# TODO: Not supported yet.
35-
# imu = BMI270(SPI(5), cs=Pin(10))
36-
37-
while (True):
38-
print('Accelerometer: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.accel()))
39-
print('Gyroscope: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.gyro()))
40-
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
41-
print("")
42-
time.sleep_ms(100)
26+
import time
27+
from bmi270 import BMI270
28+
from machine import Pin, SPI, I2C
29+
30+
# Init in I2C mode.
31+
imu = BMI270(I2C(1, scl=Pin(15), sda=Pin(14)))
32+
33+
# Or init in SPI mode.
34+
# TODO: Not supported yet.
35+
# imu = BMI270(SPI(5), cs=Pin(10))
36+
37+
while (True):
38+
print('Accelerometer: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.accel()))
39+
print('Gyroscope: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.gyro()))
40+
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
41+
print("")
42+
time.sleep_ms(100)
4343
"""
4444

4545
import array

micropython/drivers/imu/bmm150/bmm150.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
THE SOFTWARE.
2323
24-
Basic example usage:
24+
Basic example usage::
2525
26-
import time
27-
from bmm150 import BMM150
28-
from machine import Pin, SPI, I2C
26+
import time
27+
from bmm150 import BMM150
28+
from machine import Pin, SPI, I2C
2929
30-
# Init in I2C mode.
31-
imu = BMM150(I2C(1, scl=Pin(15), sda=Pin(14)))
30+
# Init in I2C mode.
31+
imu = BMM150(I2C(1, scl=Pin(15), sda=Pin(14)))
3232
33-
# Or init in SPI mode.
34-
# TODO: Not supported yet.
35-
# imu = BMM150(SPI(5), cs=Pin(10))
33+
# Or init in SPI mode.
34+
# TODO: Not supported yet.
35+
# imu = BMM150(SPI(5), cs=Pin(10))
3636
37-
while (True):
38-
print('magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
39-
time.sleep_ms(100)
37+
while (True):
38+
print('magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
39+
time.sleep_ms(100)
4040
"""
4141

4242
import array

micropython/drivers/imu/lsm6dsox/lsm6dsox.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@
2525
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2626
THE SOFTWARE.
2727
28-
Basic example usage:
28+
Basic example usage::
2929
30-
import time
31-
from lsm6dsox import LSM6DSOX
30+
import time
31+
from lsm6dsox import LSM6DSOX
3232
33-
from machine import Pin, SPI, I2C
34-
# Init in I2C mode.
35-
lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))
33+
from machine import Pin, SPI, I2C
34+
# Init in I2C mode.
35+
lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))
3636
37-
# Or init in SPI mode.
38-
#lsm = LSM6DSOX(SPI(5), cs=Pin(10))
37+
# Or init in SPI mode.
38+
#lsm = LSM6DSOX(SPI(5), cs=Pin(10))
3939
40-
while (True):
41-
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.accel()))
42-
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.gyro()))
43-
print("")
44-
time.sleep_ms(100)
40+
while (True):
41+
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.accel()))
42+
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.gyro()))
43+
print("")
44+
time.sleep_ms(100)
4545
"""
4646

4747
import array

micropython/drivers/imu/lsm9ds1/lsm9ds1.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
The sensor contains an accelerometer / gyroscope / magnetometer
2828
Uses the internal FIFO to store up to 16 gyro/accel data, use the iter_accel_gyro generator to access it.
2929
30-
Example usage:
30+
Example usage::
3131
32-
import time
33-
from lsm9ds1 import LSM9DS1
34-
from machine import Pin, I2C
32+
import time
33+
from lsm9ds1 import LSM9DS1
34+
from machine import Pin, I2C
3535
36-
imu = LSM9DS1(I2C(1, scl=Pin(15), sda=Pin(14)))
36+
imu = LSM9DS1(I2C(1, scl=Pin(15), sda=Pin(14)))
3737
38-
while (True):
39-
#for g,a in imu.iter_accel_gyro(): print(g,a) # using fifo
40-
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.accel()))
41-
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
42-
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.gyro()))
43-
print("")
44-
time.sleep_ms(100)
38+
while (True):
39+
#for g,a in imu.iter_accel_gyro(): print(g,a) # using fifo
40+
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.accel()))
41+
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
42+
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.gyro()))
43+
print("")
44+
time.sleep_ms(100)
4545
"""
4646

4747
import array

micropython/drivers/sensor/ds18x20/ds18x20.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# DS18x20 temperature sensor driver for MicroPython.
1+
"""DS18x20 temperature sensor driver for MicroPython."""
2+
23
# MIT license; Copyright (c) 2016 Damien P. George
34

45
from micropython import const

micropython/drivers/sensor/hs3003/hs3003.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@
2222
THE SOFTWARE.
2323
2424
HS3003 driver for MicroPython.
25+
------------------------------
2526
26-
Example usage:
27+
Example usage::
2728
28-
import time
29-
from hs3003 import HS3003
30-
from machine import Pin, I2C
29+
import time
30+
from hs3003 import HS3003
31+
from machine import Pin, I2C
3132
32-
bus = I2C(1, scl=Pin(15), sda=Pin(14))
33-
hts = HS3003(bus)
33+
bus = I2C(1, scl=Pin(15), sda=Pin(14))
34+
hts = HS3003(bus)
35+
36+
while True:
37+
rH = hts.humidity()
38+
temp = hts.temperature()
39+
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
40+
time.sleep_ms(100)
3441
35-
while True:
36-
rH = hts.humidity()
37-
temp = hts.temperature()
38-
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
39-
time.sleep_ms(100)
4042
"""
4143

4244
import struct

micropython/drivers/sensor/hts221/hts221.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,24 @@
2323
THE SOFTWARE.
2424
2525
HTS221 driver driver for MicroPython.
26+
-------------------------------------
27+
2628
Original source: https://github.com/ControlEverythingCommunity/HTS221/blob/master/Python/HTS221.py
2729
28-
Example usage:
30+
Example usage::
2931
30-
import time
31-
import hts221
32-
from machine import Pin, I2C
32+
import time
33+
import hts221
34+
from machine import Pin, I2C
3335
34-
bus = I2C(1, scl=Pin(15), sda=Pin(14))
35-
hts = hts221.HTS221(bus)
36+
bus = I2C(1, scl=Pin(15), sda=Pin(14))
37+
hts = hts221.HTS221(bus)
3638
37-
while (True):
38-
rH = hts.humidity()
39-
temp = hts.temperature()
40-
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
41-
time.sleep_ms(100)
39+
while (True):
40+
rH = hts.humidity()
41+
temp = hts.temperature()
42+
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
43+
time.sleep_ms(100)
4244
"""
4345

4446
import struct

micropython/ucontextlib/ucontextlib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __exit__(self, type, value, traceback):
7878
def contextmanager(func):
7979
"""@contextmanager decorator.
8080
81-
Typical usage:
81+
Typical usage::
8282
8383
@contextmanager
8484
def some_generator(<arguments>):
@@ -88,12 +88,12 @@ def some_generator(<arguments>):
8888
finally:
8989
<cleanup>
9090
91-
This makes this:
91+
This makes this::
9292
9393
with some_generator(<arguments>) as <variable>:
9494
<body>
9595
96-
equivalent to this:
96+
equivalent to this::
9797
9898
<setup>
9999
try:

python-ecosys/iperf3/iperf3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
66
Supported modes: server & client, TCP & UDP, normal & reverse
77
8-
Usage:
8+
Usage::
9+
910
import iperf3
1011
iperf3.server()
1112
iperf3.client('192.168.1.5')

python-stdlib/cmd/cmd.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
Interpreters constructed with this class obey the following conventions:
44
55
1. End of file on input is processed as the command 'EOF'.
6-
2. A command is parsed out of each line by collecting the prefix composed
6+
2. A command is parsed out of each line by collecting the prefix composed
77
of characters in the identchars member.
8-
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
8+
3. A command 'foo' is dispatched to a method 'do_foo()'; the do_ method
99
is passed a single argument consisting of the remainder of the line.
1010
4. Typing an empty line repeats the last command. (Actually, it calls the
11-
method `emptyline', which may be overridden in a subclass.)
12-
5. There is a predefined `help' method. Given an argument `topic', it
13-
calls the command `help_topic'. With no arguments, it lists all topics
11+
method ``emptyline``, which may be overridden in a subclass.)
12+
5. There is a predefined ``help`` method. Given an argument 'topic', it
13+
calls the command 'help_topic'. With no arguments, it lists all topics
1414
with defined help_ functions, broken into up to three topics; documented
1515
commands, miscellaneous help topics, and undocumented commands.
16-
6. The command '?' is a synonym for `help'. The command '!' is a synonym
17-
for `shell', if a do_shell method exists.
16+
6. The command '?' is a synonym for 'help'. The command '!' is a synonym
17+
for 'shell', if a do_shell method exists.
1818
7. If completion is enabled, completing commands will be done automatically,
1919
and completing of commands args is done by calling complete_foo() with
2020
arguments text, line, begidx, endidx. text is string we are matching
@@ -23,32 +23,33 @@
2323
indexes of the text being matched, which could be used to provide
2424
different completion depending upon which position the argument is in.
2525
26-
The `default' method may be overridden to intercept commands for which there
26+
The 'default' method may be overridden to intercept commands for which there
2727
is no do_ method.
2828
29-
The `completedefault' method may be overridden to intercept completions for
29+
The ``completedefault`` method may be overridden to intercept completions for
3030
commands that have no complete_ method.
3131
32-
The data member `self.ruler' sets the character used to draw separator lines
32+
The data member ``self.ruler`` sets the character used to draw separator lines
3333
in the help messages. If empty, no ruler line is drawn. It defaults to "=".
3434
35-
If the value of `self.intro' is nonempty when the cmdloop method is called,
35+
If the value of ``self.intro`` is nonempty when the cmdloop method is called,
3636
it is printed out on interpreter startup. This value may be overridden
3737
via an optional argument to the cmdloop() method.
3838
39-
The data members `self.doc_header', `self.misc_header', and
40-
`self.undoc_header' set the headers used for the help function's
39+
The data members ``self.doc_header``, ``self.misc_header``, and
40+
``self.undoc_header`` set the headers used for the help function's
4141
listings of documented functions, miscellaneous topics, and undocumented
4242
functions respectively.
4343
44-
----------------------------------------------------------------------------
45-
This is a copy of python's Cmd, but leaves out features that aren't relevant
46-
or can't currently be implemented for MicroPython.
44+
.. caution::
45+
This is a copy of python's Cmd, but leaves out features that aren't relevant
46+
or can't currently be implemented for MicroPython.
4747
48-
One of the notable deviations is that since MicroPython strips doc strings,
49-
this means that that help by doc string feature doesn't work.
48+
One of the notable deviations is that since MicroPython strips doc strings,
49+
this means that that help by doc string feature doesn't work.
50+
51+
completions have also been stripped out.
5052
51-
completions have also been stripped out.
5253
"""
5354

5455
import sys

0 commit comments

Comments
 (0)