Skip to content

Commit 0cfb4ae

Browse files
committed
fix imported-members doc; describe new import scheme
1 parent 0a6ba00 commit 0cfb4ae

File tree

1 file changed

+57
-8
lines changed

1 file changed

+57
-8
lines changed

docs/api.rst

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,68 @@
1-
2-
.. If you created a package, create one automodule per module in the package.
3-
4-
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
5-
.. use this format as the module name: "adafruit_foo.foo"
6-
71
API Reference
82
#############
93

104
.. automodule:: adafruit_esp32spi.adafruit_esp32spi
5+
6+
.. note::
7+
As of version 11.0.0, it simpler to import this library and its submodules
8+
The examples in this documentation use the new import names.
9+
The old import names are still available, but are deprecated and may be removed in a future release.
10+
11+
Before version 11.0.0, the library was structured like this (not all components are shown):
12+
13+
* ``adafruit_esp32spi``
14+
15+
* ``adafruit_esp32spi``
16+
17+
* ``ESP32_SPIcontrol``
18+
19+
* ``adafruit_esp32spi_socketpool``
20+
21+
* ``SocketPool``
22+
23+
* ``adafruit_esp32spi_wifimanager``
24+
25+
* ``WiFiManager``
26+
27+
.. code:: python
28+
29+
# Old import scheme
30+
from adafruit_esp32spi import adafruit_esp32spi
31+
from adafruit_esp32spi.adafruit_esp32spi_socketpool import SocketPool
32+
from adafruit_esp32spi.adafruit_esp32spi_wifimanager import WiFiManager
33+
34+
Now, the duplicated top-most name is not needed, and there are shorter names for the submodules.
35+
36+
* ``adafruit_esp32spi``
37+
38+
* ``ESP32_SPIcontrol``
39+
40+
* ``socketpool``
41+
42+
* ``SocketPool``
43+
44+
* ``wifimanager``
45+
46+
* ``WiFiManager``
47+
48+
.. code:: python
49+
50+
# New import scheme
51+
import adafruit_esp32spi
52+
from adafruit_esp32spi.socketpool import SocketPool
53+
from adafruit_esp32spi.wifimanager import WiFiManager
54+
55+
56+
.. automodule:: adafruit_esp32spi
57+
:imported-members:
1158
:members:
1259

13-
.. automodule:: adafruit_esp32spi.adafruit_esp32spi_socketpool
60+
.. automodule:: adafruit_esp32spi.socketpool
61+
:imported-members:
1462
:members:
1563

16-
.. automodule:: adafruit_esp32spi.adafruit_esp32spi_wifimanager
64+
.. automodule:: adafruit_esp32spi.wifimanager
65+
:imported-members:
1766
:members:
1867

1968
.. automodule:: adafruit_esp32spi.digitalio

0 commit comments

Comments
 (0)