Skip to content

Commit af4354a

Browse files
committed
More linting
1 parent e4245f4 commit af4354a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

adafruit_pyportal/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ def fetch(self, refresh_url=None, timeout=10):
381381
print("Error displaying cached image. " + error.args[0])
382382
if self._default_bg is not None:
383383
self.graphics.set_background(self._default_bg)
384+
except KeyError as error:
385+
print("Error finding image data. '" + error.args[0] + "' not found.")
386+
self.set_background(self._default_bg)
384387

385388
if content_type == CONTENT_JSON:
386389
values = self.network.process_json(json_out, json_path)

adafruit_pyportal/graphics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __init__(self, *, default_bg=None, debug=False):
4646
# Tracks whether we've hidden the background when we showed the QR code.
4747
self._qr_only = False
4848

49+
# pylint: disable=arguments-differ
4950
def qrcode(self, qr_data, *, qr_size=1, x=0, y=0, hide_background=False):
5051
"""Display a QR code
5152
@@ -65,6 +66,8 @@ def qrcode(self, qr_data, *, qr_size=1, x=0, y=0, hide_background=False):
6566
self.display.show(self._qr_group)
6667
self._qr_only = hide_background
6768

69+
# pylint: enable=arguments-differ
70+
6871
def hide_QR(self): # pylint: disable=invalid-name
6972
"""Clear any QR codes that are currently on the screen"""
7073

adafruit_pyportal/network.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ def process_image(self, json_data, sd_card=False):
136136
image_url = self._image_url_path
137137

138138
if self._image_json_path:
139-
try:
140-
image_url = self.json_traverse(json_data, self._image_json_path)
141-
except KeyError as error:
142-
print("Error finding image data. '" + error.args[0] + "' not found.")
143-
self.set_background(self._default_bg)
139+
image_url = self.json_traverse(json_data, self._image_json_path)
144140

145141
iwidth = 0
146142
iheight = 0

0 commit comments

Comments
 (0)