X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/996c02e4f83c0034202ea81767a96fb42d75df09..HEAD:/displayio/__init__.py?ds=inline diff --git a/displayio/__init__.py b/displayio/__init__.py index fad38f0..e42d24a 100644 --- a/displayio/__init__.py +++ b/displayio/__init__.py @@ -20,11 +20,6 @@ import threading import time from typing import Union -import fourwire -import i2cdisplaybus -from busdisplay import BusDisplay -from busdisplay._displaybus import _DisplayBus -from epaperdisplay import EPaperDisplay from ._bitmap import Bitmap from ._colorspace import Colorspace from ._colorconverter import ColorConverter @@ -34,11 +29,6 @@ from ._palette import Palette from ._tilegrid import TileGrid from ._constants import CIRCUITPY_DISPLAY_LIMIT -# 8.x Backwards compatibility, remove at 10.x or -# when compatibility is removed from core displayio -Display = BusDisplay -FourWire = fourwire.FourWire -I2CDisplay = i2cdisplaybus.I2CDisplayBus __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git" @@ -53,8 +43,8 @@ def _background(stop_event): while not stop_event.is_set(): for display in displays: display._background() # pylint: disable=protected-access - - # relax system when _background does nothing + + # relax system when _background does nothing # and we are in a while True loop consuming lots of CPU time.sleep(0.0) @@ -74,14 +64,16 @@ def release_displays() -> None: display_buses.clear() -def allocate_display(new_display: Union[BusDisplay, EPaperDisplay]) -> None: +def allocate_display( + new_display: Union["busdisplay.BusDisplay", "epaperdisplay.EPaperDisplay"] +) -> None: """Add a display to the displays pool and return the new display""" if len(displays) >= CIRCUITPY_DISPLAY_LIMIT: raise RuntimeError("Too many displays") displays.append(new_display) -def allocate_display_bus(new_display_bus: _DisplayBus) -> None: +def allocate_display_bus(new_display_bus: "busdisplay._displaybus._DisplayBus") -> None: """Add a display bus to the display_buses pool and return the new display bus""" if len(display_buses) >= CIRCUITPY_DISPLAY_LIMIT: raise RuntimeError( @@ -91,7 +83,9 @@ def allocate_display_bus(new_display_bus: _DisplayBus) -> None: background_thread_stop_event = threading.Event() -background_thread = threading.Thread(target=_background,args=(background_thread_stop_event,), daemon=True) +background_thread = threading.Thread( + target=_background, args=(background_thread_stop_event,), daemon=True +) # Start the background thread