From 1f42993525c1bc43ed4b0d50cfa40257a3e799f4 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Sat, 14 Nov 2020 13:27:17 -0600 Subject: [PATCH 1/2] Correct bug of modifying self rather than self.local_group when text is blank --- adafruit_display_text/bitmap_label.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index 26332b7..543d043 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -228,9 +228,9 @@ def _reset_text( 0, # zero width with text == "" 0, # zero height with text == "" ) - # Clear out any items in the self Group, in case this is an update to the bitmap_label - for _ in self: - self.pop(0) + # Clear out any items in the self.local_group Group, in case this is an update to the bitmap_label + for _ in self.local_group: + self.local_group.pop(0) else: # The text string is not empty, so create the Bitmap and TileGrid and # append to the self Group From 7f9dc63ed57f14cac5e64ed0c0a75e4757bdea97 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Sat, 14 Nov 2020 13:30:44 -0600 Subject: [PATCH 2/2] Fix long comment line for pylint --- adafruit_display_text/bitmap_label.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index 543d043..348f5e4 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -228,7 +228,8 @@ def _reset_text( 0, # zero width with text == "" 0, # zero height with text == "" ) - # Clear out any items in the self.local_group Group, in case this is an update to the bitmap_label + # Clear out any items in the self.local_group Group, in case this is an + # update to the bitmap_label for _ in self.local_group: self.local_group.pop(0)