Skip to content

Commit 32d70ed

Browse files
committed
Made suggested changes
1 parent e40b7fc commit 32d70ed

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

adafruit_portalbase/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class PortalBase:
4949
on-board NeoPixel. Defaults to ``None``, to not use the status LED
5050
:param json_transform: A function or a list of functions to call with the parsed JSON.
5151
Changes and additions are permitted for the ``dict`` object.
52+
:param success_callback: A function we'll call if you like, when we fetch data successfully.
53+
Defaults to ``None``.
5254
:param debug: Turn on debug print outs. Defaults to False.
5355
5456
"""

adafruit_portalbase/network.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,12 @@ def get_io_data(self, feed_key):
398398
io_client = self._get_io_client()
399399

400400
while True:
401-
# try:
402-
return io_client.receive_all_data(feed_key)
403-
# except RuntimeError as exception:
404-
# print("An error occured, retrying! 1 -", exception)
405-
# continue
406-
# break
401+
try:
402+
return io_client.receive_all_data(feed_key)
403+
except RuntimeError as exception:
404+
print("An error occured, retrying! 1 -", exception)
405+
continue
406+
break
407407

408408
def fetch(self, url, *, headers=None, timeout=10):
409409
"""Fetch data from the specified url and return a response object

0 commit comments

Comments
 (0)