1616
1717import terminalio
1818
19+ try :
20+ from typing import List
21+ except ImportError :
22+ pass
23+
1924__version__ = "0.0.0+auto.0"
2025__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Notification.git"
2126
2732class NotificationFree (displayio .Group ):
2833 """Widget to show when no notifications are active."""
2934
30- def __init__ (self , width , height , * , dark_mode = True ):
35+ def __init__ (self , width : int , height : int , * , dark_mode : bool = True ):
3136 # pylint: disable=unused-argument
3237 super ().__init__ ()
3338
@@ -46,7 +51,15 @@ def __init__(self, width, height, *, dark_mode=True):
4651class PlainNotification (displayio .Group ):
4752 """Plain text widget with a title and message."""
4853
49- def __init__ (self , title , message , width , height , * , dark_mode = True ):
54+ def __init__ (
55+ self ,
56+ title : str ,
57+ message : str ,
58+ width : int ,
59+ height : int ,
60+ * ,
61+ dark_mode : bool = True
62+ ):
5063 super ().__init__ ()
5164
5265 # Set text, font, and color
@@ -71,7 +84,7 @@ def __init__(self, title, message, width, height, *, dark_mode=True):
7184
7285 # cribbed from pyportal
7386 @staticmethod
74- def _wrap_nicely (string , max_chars ) :
87+ def _wrap_nicely (string : str , max_chars : int ) -> List [ str ] :
7588 """A helper that will return a list of lines with word-break wrapping.
7689 :param str string: The text to be wrapped.
7790 :param int max_chars: The maximum number of characters on a line before wrapping.
0 commit comments