Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d65fd65

Browse files
rgrizzelltekktrik
andauthoredMay 17, 2022
Apply suggestions from code review
Co-authored-by: Alec Delaney <[email protected]>
1 parent 681d4e3 commit d65fd65

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed
 

‎adafruit_display_text/scrolling_label.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Text.git"
2828

2929
try:
30-
from typing import Union, Optional
31-
from fontio import BuiltinFont
32-
from adafruit_bitmap_font.bdf import BDF
33-
from adafruit_bitmap_font.pcf import PCF
30+
from typing import Optional
31+
from fontio import FontProtocol
3432
except ImportError:
3533
pass
3634

@@ -43,7 +41,7 @@ class ScrollingLabel(bitmap_label.Label):
4341
in order to show the full text if it's larger than the fixed-width.
4442
4543
:param font: The font to use for the label.
46-
:type font: ~BuiltinFont, ~BDF, or ~PCF
44+
:type: ~FontProtocol
4745
:param int max_characters: The number of characters that sets the fixed-width. Default is 10.
4846
:param str text: The full text to show in the label. If this is longer than
4947
``max_characters`` then the label will scroll to show everything.
@@ -55,8 +53,8 @@ class ScrollingLabel(bitmap_label.Label):
5553
# pylint: disable=too-many-arguments
5654
def __init__(
5755
self,
58-
font: Union[BuiltinFont, BDF, PCF],
59-
max_characters: Optional[int] = 10,
56+
font: FontProtocol,
57+
max_characters: int = 10,
6058
text: Optional[str] = "",
6159
animate_time: Optional[float] = 0.3,
6260
current_index: Optional[int] = 0,
@@ -135,7 +133,7 @@ def full_text(self) -> str:
135133
"""The full text to be shown. If it's longer than ``max_characters`` then
136134
scrolling will occur as needed.
137135
138-
:return string: The full text of this label.
136+
:return str: The full text of this label.
139137
"""
140138
return self._full_text
141139

0 commit comments

Comments
 (0)
Please sign in to comment.