Skip to content

Commit 69e3c7c

Browse files
committed
Pylint corrections
1 parent 8655012 commit 69e3c7c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

adafruit_display_text/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
"""
66
Display Text module helper functions
77
"""
8+
89
try:
910
from typing import Tuple
10-
except:
11+
except ImportError:
1112
pass
1213
from displayio import Group, Palette
1314

1415

15-
def wrap_text_to_pixels(string, max_width, font=None, indent0="", indent1=""):
16+
def wrap_text_to_pixels(
17+
string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
18+
) -> None:
1619
"""wrap_text_to_pixels function
1720
A helper that will return a list of lines with word-break wrapping.
1821
Leading and trailing whitespace in your string will be removed. If
@@ -30,7 +33,7 @@ def wrap_text_to_pixels(string, max_width, font=None, indent0="", indent1=""):
3033
input text at max_width pixels size
3134
3235
"""
33-
# pylint: disable=too-many-locals too-many-branches
36+
# pylint: disable=too-many-locals, too-many-branches
3437
if font is None:
3538

3639
def measure(string):

adafruit_display_text/bitmap_label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"""
2525
try:
2626
from typing import Tuple
27-
except:
27+
except ImportError:
2828
pass
2929
import displayio
3030

adafruit_display_text/label.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def _update_background_color(self, new_color: int) -> None:
227227
self.local_group.pop(0)
228228
self._added_background_tilegrid = False
229229

230+
# pylint: disable = too-many-branches, too-many-statements
230231
def _update_text(
231232
self, new_text: str
232233
) -> None: # pylint: disable=too-many-locals ,too-many-branches, too-many-statements

0 commit comments

Comments
 (0)