@@ -213,12 +213,12 @@ def brightness(self):
213
213
def brightness (self , value ):
214
214
self .display .brightness = value
215
215
216
- # pylint: disable=too-many-arguments,too-many-locals
217
- def show_business_card (self , image_name = None , email_string = None ,
216
+ def show_business_card (self , * , image_name = None , email_string = None ,
218
217
email_scale = 1 , email_font = terminalio .FONT , dwell = 20 ):
219
218
"""Display a bitmap image and a text string, such as a personal image and email address.
220
219
221
- :param str image_name: The name of the bitmap image including .bmp, e.g. ``"Blinka.bmp"``.
220
+ :param str image_name: REQUIRED. The name of the bitmap image including .bmp, e.g.
221
+ ``"Blinka.bmp"``.
222
222
:param str email_string: A string to display along the bottom of the display, e.g.
223
223
``"blinka@adafruit.com"``.
224
224
:param int email_scale: The scale of ``email_string``. Defaults to 1.
@@ -233,14 +233,15 @@ def show_business_card(self, image_name=None, email_string=None,
233
233
face_image = displayio .TileGrid (on_disk_bitmap , pixel_shader = displayio .ColorConverter ())
234
234
business_card_splash .append (face_image )
235
235
self .display .wait_for_frame ()
236
- email_group = displayio .Group (scale = email_scale )
237
- email_label = Label (email_font , text = email_string )
238
- (_ , _ , width , height ) = email_label .bounding_box
239
- email_label .x = ((self .display .width // (2 * email_scale )) - width // 2 )
240
- email_label .y = int (height // (0.13 * email_scale ))
241
- email_label .color = 0xFFFFFF
242
- email_group .append (email_label )
243
- business_card_splash .append (email_group )
236
+ if email_string is not None and len (email_string ) > 0 :
237
+ email_group = displayio .Group (scale = email_scale )
238
+ email_label = Label (email_font , text = email_string )
239
+ (_ , _ , width , height ) = email_label .bounding_box
240
+ email_label .x = ((self .display .width // (2 * email_scale )) - width // 2 )
241
+ email_label .y = int (height // (0.13 * email_scale ))
242
+ email_label .color = 0xFFFFFF
243
+ email_group .append (email_label )
244
+ business_card_splash .append (email_group )
244
245
time .sleep (dwell )
245
246
246
247
# pylint: disable=too-many-locals
@@ -339,7 +340,7 @@ def bitmap_qr(matrix):
339
340
bitmap [x + border_pixels , y + border_pixels ] = 0
340
341
return bitmap
341
342
342
- def show_qr_code (self , data = "https://circuitpython.org" , dwell = 20 ):
343
+ def show_qr_code (self , * , data = "https://circuitpython.org" , dwell = 20 ):
343
344
"""Generate a QR code and display it for ``dwell`` seconds.
344
345
345
346
:param string data: A string of data for the QR code
0 commit comments