16
16
17
17
import terminalio
18
18
19
+ try :
20
+ from typing import List
21
+ except ImportError :
22
+ pass
23
+
19
24
__version__ = "0.0.0+auto.0"
20
25
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Notification.git"
21
26
27
32
class NotificationFree (displayio .Group ):
28
33
"""Widget to show when no notifications are active."""
29
34
30
- def __init__ (self , width , height , * , dark_mode = True ):
35
+ def __init__ (self , width : int , height : int , * , dark_mode : bool = True ):
31
36
# pylint: disable=unused-argument
32
37
super ().__init__ ()
33
38
@@ -46,7 +51,15 @@ def __init__(self, width, height, *, dark_mode=True):
46
51
class PlainNotification (displayio .Group ):
47
52
"""Plain text widget with a title and message."""
48
53
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
+ ):
50
63
super ().__init__ ()
51
64
52
65
# Set text, font, and color
@@ -71,7 +84,7 @@ def __init__(self, title, message, width, height, *, dark_mode=True):
71
84
72
85
# cribbed from pyportal
73
86
@staticmethod
74
- def _wrap_nicely (string , max_chars ) :
87
+ def _wrap_nicely (string : str , max_chars : int ) -> List [ str ] :
75
88
"""A helper that will return a list of lines with word-break wrapping.
76
89
:param str string: The text to be wrapped.
77
90
:param int max_chars: The maximum number of characters on a line before wrapping.
0 commit comments