Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alec Delaney <89490472+tekktrik@users.noreply.github.com>
  • Loading branch information
rgrizzell and tekktrik authored May 17, 2022
1 parent 681d4e3 commit d65fd65
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions adafruit_display_text/scrolling_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Text.git"

try:
from typing import Union, Optional
from fontio import BuiltinFont
from adafruit_bitmap_font.bdf import BDF
from adafruit_bitmap_font.pcf import PCF
from typing import Optional
from fontio import FontProtocol
except ImportError:
pass

Expand All @@ -43,7 +41,7 @@ class ScrollingLabel(bitmap_label.Label):
in order to show the full text if it's larger than the fixed-width.
:param font: The font to use for the label.
:type font: ~BuiltinFont, ~BDF, or ~PCF
:type: ~FontProtocol
:param int max_characters: The number of characters that sets the fixed-width. Default is 10.
:param str text: The full text to show in the label. If this is longer than
``max_characters`` then the label will scroll to show everything.
Expand All @@ -55,8 +53,8 @@ class ScrollingLabel(bitmap_label.Label):
# pylint: disable=too-many-arguments
def __init__(
self,
font: Union[BuiltinFont, BDF, PCF],
max_characters: Optional[int] = 10,
font: FontProtocol,
max_characters: int = 10,
text: Optional[str] = "",
animate_time: Optional[float] = 0.3,
current_index: Optional[int] = 0,
Expand Down Expand Up @@ -135,7 +133,7 @@ def full_text(self) -> str:
"""The full text to be shown. If it's longer than ``max_characters`` then
scrolling will occur as needed.
:return string: The full text of this label.
:return str: The full text of this label.
"""
return self._full_text

Expand Down

0 comments on commit d65fd65

Please sign in to comment.