@@ -135,7 +135,7 @@ class PyPortal:
135
135
``False``, no wrapping.
136
136
:param text_maxlen: The max length of the text for text wrapping. Defaults to 0.
137
137
: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.
139
139
Changes and additions are permitted for the ``dict`` object.
140
140
:param image_json_path: The JSON traversal path for a background image to display. Defaults to
141
141
``None``.
@@ -164,7 +164,7 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
164
164
default_bg = 0x000000 , status_neopixel = None ,
165
165
text_font = None , text_position = None , text_color = 0x808080 ,
166
166
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 ,
168
168
image_resize = None , image_position = None ,
169
169
caption_text = None , caption_font = None , caption_position = None ,
170
170
caption_color = 0x808080 , image_url_path = None ,
@@ -354,12 +354,12 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
354
354
self ._text = None
355
355
356
356
# 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 )
361
361
else :
362
- self ._json_transforms .extend (filter (callable , json_transforms ))
362
+ self ._json_transform .extend (filter (callable , json_transform ))
363
363
364
364
self ._image_json_path = image_json_path
365
365
self ._image_url_path = image_url_path
@@ -801,7 +801,7 @@ def fetch(self, refresh_url=None):
801
801
802
802
# optional JSON post processing, apply any transformations
803
803
# 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 ):
805
805
try :
806
806
json_transform (json_out )
807
807
except Exception as error :
0 commit comments