Skip to content

Commit fb7b885

Browse files
committed
Bring documentation up-to-date with the develop branch
Uses the new project structure in sphinx docs, fixes a couple of docstring issues. Fixes #441
1 parent ee75c5c commit fb7b885

File tree

8 files changed

+28
-57
lines changed

8 files changed

+28
-57
lines changed

docs/motors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Motor classes
22
=============
33

4-
.. currentmodule:: ev3dev.core
4+
.. currentmodule:: ev3dev.motor
55

66
Tacho motor
77
-----------

docs/other.rst

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
11
Other classes
22
=============
33

4-
.. currentmodule:: ev3dev.core
5-
6-
Remote Control
7-
--------------
8-
9-
.. autoclass:: RemoteControl
10-
:members:
11-
:inherited-members:
12-
13-
.. rubric:: Event handlers
14-
15-
These will be called when state of the corresponding button is changed:
16-
17-
.. py:data:: on_red_up
18-
.. py:data:: on_red_down
19-
.. py:data:: on_blue_up
20-
.. py:data:: on_blue_down
21-
.. py:data:: on_beacon
22-
23-
.. rubric:: Member functions and properties
24-
25-
Beacon Seeker
26-
-------------
27-
28-
.. autoclass:: BeaconSeeker
29-
:members:
30-
:inherited-members:
31-
324
Button
335
------
346

35-
.. autoclass:: ev3dev.ev3.Button
7+
.. autoclass:: ev3dev.button.Button
368
:members:
379
:inherited-members:
3810

@@ -52,10 +24,10 @@ Button
5224
Leds
5325
----
5426

55-
.. autoclass:: Led
27+
.. autoclass:: ev3dev.led.Led
5628
:members:
5729

58-
.. autoclass:: ev3dev.ev3.Leds
30+
.. autoclass:: ev3dev.led.Leds
5931
:members:
6032

6133
.. rubric:: EV3 platform
@@ -87,26 +59,26 @@ Leds
8759
Power Supply
8860
------------
8961

90-
.. autoclass:: PowerSupply
62+
.. autoclass:: ev3dev.power.PowerSupply
9163
:members:
9264

9365
Sound
9466
-----
9567

96-
.. autoclass:: Sound
68+
.. autoclass:: ev3dev.sound.Sound
9769
:members:
9870

9971
Screen
10072
------
10173

102-
.. autoclass:: Screen
74+
.. autoclass:: ev3dev.display.Display
10375
:members:
10476
:show-inheritance:
10577

10678
Bitmap fonts
10779
^^^^^^^^^^^^
10880

109-
The :py:class:`Screen` class allows to write text on the LCD using python
81+
The :py:class:`Display` class allows to write text on the LCD using python
11082
imaging library (PIL) interface (see description of the ``text()`` method
11183
`here <http://pillow.readthedocs.io/en/3.1.x/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.Draw.text>`_).
11284
The ``ev3dev.fonts`` module contains bitmap fonts in PIL format that should
@@ -115,7 +87,7 @@ look good on a tiny EV3 screen:
11587
.. code-block:: py
11688
11789
import ev3dev.fonts as fonts
118-
screen.draw.text((10,10), 'Hello World!', font=fonts.load('luBS14'))
90+
display.draw.text((10,10), 'Hello World!', font=fonts.load('luBS14'))
11991
12092
.. autofunction:: ev3dev.fonts.available
12193

@@ -129,5 +101,5 @@ to EV3 screen size:
129101
Lego Port
130102
---------
131103

132-
.. autoclass:: LegoPort
104+
.. autoclass:: ev3dev.port.LegoPort
133105
:members:

docs/sensors.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ Sensor
66

77
This is the base class all the other sensor classes are derived from.
88

9-
.. currentmodule:: ev3dev.core
10-
11-
.. autoclass:: Sensor
9+
.. autoclass:: ev3dev.sensor.Sensor
1210
:members:
1311

1412
Special sensor classes
@@ -23,7 +21,7 @@ sure the sensor is in the required mode and then returns the specified value.
2321
Touch Sensor
2422
########################
2523

26-
.. autoclass:: TouchSensor
24+
.. autoclass:: ev3dev.sensor.lego.TouchSensor
2725
:members:
2826
:show-inheritance:
2927

@@ -32,7 +30,7 @@ Touch Sensor
3230
Color Sensor
3331
########################
3432

35-
.. autoclass:: ColorSensor
33+
.. autoclass:: ev3dev.sensor.lego.ColorSensor
3634
:members:
3735
:show-inheritance:
3836

@@ -41,7 +39,7 @@ Color Sensor
4139
Ultrasonic Sensor
4240
########################
4341

44-
.. autoclass:: UltrasonicSensor
42+
.. autoclass:: ev3dev.sensor.lego.UltrasonicSensor
4543
:members:
4644
:show-inheritance:
4745

@@ -50,7 +48,7 @@ Ultrasonic Sensor
5048
Gyro Sensor
5149
########################
5250

53-
.. autoclass:: GyroSensor
51+
.. autoclass:: ev3dev.sensor.lego.GyroSensor
5452
:members:
5553
:show-inheritance:
5654

@@ -59,7 +57,7 @@ Gyro Sensor
5957
Infrared Sensor
6058
########################
6159

62-
.. autoclass:: InfraredSensor
60+
.. autoclass:: ev3dev.sensor.lego.InfraredSensor
6361
:members:
6462
:show-inheritance:
6563

@@ -68,7 +66,7 @@ Infrared Sensor
6866
Sound Sensor
6967
########################
7068

71-
.. autoclass:: SoundSensor
69+
.. autoclass:: ev3dev.sensor.lego.SoundSensor
7270
:members:
7371
:show-inheritance:
7472

@@ -77,7 +75,7 @@ Sound Sensor
7775
Light Sensor
7876
########################
7977

80-
.. autoclass:: LightSensor
78+
.. autoclass:: ev3dev.sensor.lego.LightSensor
8179
:members:
8280
:show-inheritance:
8381

docs/spec.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ API reference
33

44
Each class in ev3dev module inherits from the base :py:class:`Device` class.
55

6-
.. autoclass:: ev3dev.core.Device
6+
.. autoclass:: ev3dev.Device
77

8-
.. autofunction:: ev3dev.core.list_device_names
8+
.. autofunction:: ev3dev.list_device_names
99

10-
.. autofunction:: ev3dev.core.list_devices
10+
.. autofunction:: ev3dev.list_devices
1111

12-
.. autofunction:: ev3dev.core.list_motors
12+
.. autofunction:: ev3dev.motor.list_motors
1313

14-
.. autofunction:: ev3dev.core.list_sensors
14+
.. autofunction:: ev3dev.sensor.list_sensors
1515

1616
.. rubric:: Contents:
1717

ev3dev/display.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def text_pixels(self, text, clear_screen=True, x=0, y=0, text_color='black', fon
347347
'text_color' : PIL says it supports "common HTML color names". There
348348
are 140 HTML color names listed here that are supported by all modern
349349
browsers. This is probably a good list to start with.
350-
https://www.w3schools.com/colors/colors_names.asp
350+
https://www.w3schools.com/colors/colors_names.asp
351351
352352
'font' : can be any font displayed here
353353
http://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/other.html#bitmap-fonts
@@ -373,7 +373,7 @@ def text_grid(self, text, clear_screen=True, x=0, y=0, text_color='black', font=
373373
'text_color' : PIL says it supports "common HTML color names". There
374374
are 140 HTML color names listed here that are supported by all modern
375375
browsers. This is probably a good list to start with.
376-
https://www.w3schools.com/colors/colors_names.asp
376+
https://www.w3schools.com/colors/colors_names.asp
377377
378378
'font' : can be any font displayed here
379379
http://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/other.html#bitmap-fonts

ev3dev/port.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# -----------------------------------------------------------------------------
2525

2626
import sys
27+
from . import Device
2728

2829
if sys.version_info < (3,4):
2930
raise SystemError('Must be using Python 3.4 or higher')

ev3dev/sensor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def list_sensors(name_pattern=Sensor.SYSTEM_DEVICE_NAME_CONVENTION, **kwargs):
299299
keyword arguments: used for matching the corresponding device
300300
attributes. For example, driver_name='lego-ev3-touch', or
301301
address=['in1', 'in3']. When argument value is a list,
302-
then a match against any entry of the list is enough.
302+
then a match against any entry of the list is enough.
303303
"""
304304
class_path = abspath(Device.DEVICE_ROOT_PATH + '/' + Sensor.SYSTEM_CLASS_NAME)
305305
return (Sensor(name_pattern=name, name_exact=True)

ev3dev/sound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def play_note(self, note, duration, volume=100, play_type=PLAY_WAIT_FOR_COMPLETE
215215
duration (float): tone duration, in seconds
216216
volume (int) the play volume, in percent of maximum volume
217217
play_type (int) the type of play (wait, no wait, loop), as defined
218-
by the ``PLAY_xxx`` constants
218+
by the ``PLAY_xxx`` constants
219219
220220
Returns:
221221
the PID of the underlying beep command if no wait play type, None otherwise

0 commit comments

Comments
 (0)