Skip to content

Commit 4d380cc

Browse files
author
Kevin J Walters
committed
Merge branch 'master' of /home/kjw/dev/circuit-python/Adafruit_CircuitPython_PyPortal
2 parents b9fd8cf + 57b2824 commit 4d380cc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

adafruit_pyportal.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class PyPortal:
135135
``False``, no wrapping.
136136
:param text_maxlen: The max length of the text for text wrapping. Defaults to 0.
137137
:param text_transform: A function that will be called on the text before display
138-
:param json_transforms: A function or a list of functions to call with the parsed JSON.
138+
:param json_transform: A function or a list of functions to call with the parsed JSON.
139139
Changes and additions are permitted for the ``dict`` object.
140140
:param image_json_path: The JSON traversal path for a background image to display. Defaults to
141141
``None``.
@@ -164,7 +164,7 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
164164
default_bg=0x000000, status_neopixel=None,
165165
text_font=None, text_position=None, text_color=0x808080,
166166
text_wrap=False, text_maxlen=0, text_transform=None,
167-
json_transforms=None, image_json_path=None,
167+
json_transform=None, image_json_path=None,
168168
image_resize=None, image_position=None,
169169
caption_text=None, caption_font=None, caption_position=None,
170170
caption_color=0x808080, image_url_path=None,
@@ -354,12 +354,12 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
354354
self._text = None
355355

356356
# Add any JSON translators
357-
self._json_transforms = []
358-
if json_transforms:
359-
if callable(json_transforms):
360-
self._json_transforms.append(json_transforms)
357+
self._json_transform = []
358+
if json_transform:
359+
if callable(json_transform):
360+
self._json_transform.append(json_transform)
361361
else:
362-
self._json_transforms.extend(filter(callable, json_transforms))
362+
self._json_transform.extend(filter(callable, json_transform))
363363

364364
self._image_json_path = image_json_path
365365
self._image_url_path = image_url_path
@@ -801,7 +801,7 @@ def fetch(self, refresh_url=None):
801801

802802
# optional JSON post processing, apply any transformations
803803
# these MAY change/add element
804-
for idx, json_transform in enumerate(self._json_transforms):
804+
for idx, json_transform in enumerate(self._json_transform):
805805
try:
806806
json_transform(json_out)
807807
except Exception as error:

0 commit comments

Comments
 (0)