@@ -141,6 +141,8 @@ class PyPortal:
141
141
:param caption_position: The position of your caption on the display as an (x, y) tuple.
142
142
Defaults to ``None``.
143
143
:param caption_color: The color of your caption. Must be a hex value, e.g. ``0x808000``.
144
+ :param image_url_path: The HTTP traversal path for a background image to display.
145
+ Defaults to ``None``.
144
146
:param debug: Turn on debug print outs. Defaults to False.
145
147
146
148
"""
@@ -151,7 +153,7 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
151
153
text_wrap = False , text_maxlen = 0 , text_transform = None ,
152
154
image_json_path = None , image_resize = None , image_position = None ,
153
155
caption_text = None , caption_font = None , caption_position = None ,
154
- caption_color = 0x808080 ,
156
+ caption_color = 0x808080 , image_url_path = None ,
155
157
success_callback = None , debug = False ):
156
158
157
159
self ._debug = debug
@@ -317,9 +319,10 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
317
319
self ._text = None
318
320
319
321
self ._image_json_path = image_json_path
322
+ self ._image_url_path = image_url_path
320
323
self ._image_resize = image_resize
321
324
self ._image_position = image_position
322
- if image_json_path :
325
+ if image_json_path or image_url_path :
323
326
if self ._debug :
324
327
print ("Init image path" )
325
328
if not self ._image_position :
@@ -690,6 +693,9 @@ def fetch(self):
690
693
if self ._regexp_path :
691
694
import re
692
695
696
+ if self ._image_url_path :
697
+ image_url = self ._image_url_path
698
+
693
699
# extract desired text/values from json
694
700
if self ._json_path :
695
701
for path in self ._json_path :
0 commit comments