From 4f7927fcc4ee4fe8f9c13bcf1994510d9efb596e Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 28 Sep 2021 19:36:22 -0500 Subject: [PATCH 1/3] adding type information --- adafruit_ili9341.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adafruit_ili9341.py b/adafruit_ili9341.py index 15dd222..a3bce6a 100644 --- a/adafruit_ili9341.py +++ b/adafruit_ili9341.py @@ -46,6 +46,11 @@ https://github.com/adafruit/circuitpython/releases """ +try: + # used for typing only + from typing import Any +except ImportError: + pass import displayio @@ -82,5 +87,5 @@ class ILI9341(displayio.Display): """ILI9341 display driver""" - def __init__(self, bus, **kwargs): + def __init__(self, bus: displayio.FourWire, **kwargs: Any): super().__init__(bus, _INIT_SEQUENCE, **kwargs) From d42c5af7398fce3e2c59ede7d5ecae0a48e32131 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 28 Sep 2021 19:53:27 -0500 Subject: [PATCH 2/3] docstrings --- adafruit_ili9341.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adafruit_ili9341.py b/adafruit_ili9341.py index a3bce6a..3c9ef79 100644 --- a/adafruit_ili9341.py +++ b/adafruit_ili9341.py @@ -85,7 +85,11 @@ # pylint: disable=too-few-public-methods class ILI9341(displayio.Display): - """ILI9341 display driver""" + """ + ILI9341 display driver + + :param displayio.FourWire bus: bus that the display is connected to + """ def __init__(self, bus: displayio.FourWire, **kwargs: Any): super().__init__(bus, _INIT_SEQUENCE, **kwargs) From 2ea1b8ad309927168995c79283f29b3e4d3822dc Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 28 Sep 2021 20:56:41 -0500 Subject: [PATCH 3/3] remove displayio from mock imports --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 140299b..90cbe40 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,6 @@ # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. # autodoc_mock_imports = ["digitalio", "busio"] -autodoc_mock_imports = ["displayio"] intersphinx_mapping = { "python": ("https://docs.python.org/3.4", None),