@@ -127,7 +127,7 @@ class PyPortal:
127
127
``False``, no wrapping.
128
128
:param text_maxlen: The max length of the text for text wrapping. Defaults to 0.
129
129
:param text_transform: A function that will be called on the text before display
130
- :param json_transforms : A function or a list of functions to call with the parsed JSON.
130
+ :param json_transform : A function or a list of functions to call with the parsed JSON.
131
131
Changes and additions are permitted for the ``dict`` object.
132
132
:param image_json_path: The JSON traversal path for a background image to display. Defaults to
133
133
``None``.
@@ -156,7 +156,7 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
156
156
default_bg = 0x000000 , status_neopixel = None ,
157
157
text_font = None , text_position = None , text_color = 0x808080 ,
158
158
text_wrap = False , text_maxlen = 0 , text_transform = None ,
159
- json_transforms = None , image_json_path = None ,
159
+ json_transform = None , image_json_path = None ,
160
160
image_resize = None , image_position = None ,
161
161
caption_text = None , caption_font = None , caption_position = None ,
162
162
caption_color = 0x808080 , image_url_path = None ,
@@ -335,12 +335,12 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
335
335
self ._text = None
336
336
337
337
# Add any JSON translators
338
- self ._json_transforms = []
339
- if json_transforms :
340
- if callable (json_transforms ):
341
- self ._json_transforms .append (json_transforms )
338
+ self ._json_transform = []
339
+ if json_transform :
340
+ if callable (json_transform ):
341
+ self ._json_transform .append (json_transform )
342
342
else :
343
- self ._json_transforms .extend (filter (callable , json_transforms ))
343
+ self ._json_transform .extend (filter (callable , json_transform ))
344
344
345
345
self ._image_json_path = image_json_path
346
346
self ._image_url_path = image_url_path
@@ -726,7 +726,7 @@ def fetch(self, refresh_url=None):
726
726
727
727
# optional JSON post processing, apply any transformations
728
728
# these MAY change/add element
729
- for idx , json_transform in enumerate (self ._json_transforms ):
729
+ for idx , json_transform in enumerate (self ._json_transform ):
730
730
try :
731
731
json_transform (json_out )
732
732
except Exception as error :
0 commit comments