From 2fc1142c042a34aa316ef7ec15ac3f85cdafc291 Mon Sep 17 00:00:00 2001 From: John Turner Date: Mon, 22 Apr 2019 17:31:33 -0400 Subject: [PATCH 1/2] Added URL option to fetch --- adafruit_pyportal.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/adafruit_pyportal.py b/adafruit_pyportal.py index d86ccb9..78aee65 100644 --- a/adafruit_pyportal.py +++ b/adafruit_pyportal.py @@ -41,6 +41,12 @@ https://github.com/adafruit/circuitpython/releases * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice +""" +""" +04/19/2019 +John Turner +Added ability to call the fetch object with a URL fetch(URL) this allows the URL to be updated once pyportal is initialized + """ import os @@ -646,9 +652,13 @@ def image_converter_url(image_url, width, height, color_depth=16): width, height, color_depth, image_url) - def fetch(self): + def fetch(self, refresh_url=None): """Fetch data from the url we initialized with, perfom any parsing, - and display text or graphics. This function does pretty much everything""" + and display text or graphics. This function does pretty much everything + Optionally update the URL + """ + if refresh_url: + self._url = refresh_url json_out = None image_url = None values = [] From 01b8a63172fb4e82f0fbb86406afd241f30b320a Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 25 Apr 2019 20:37:54 -0400 Subject: [PATCH 2/2] removed comments --- adafruit_pyportal.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/adafruit_pyportal.py b/adafruit_pyportal.py index 78aee65..fd46b28 100644 --- a/adafruit_pyportal.py +++ b/adafruit_pyportal.py @@ -41,12 +41,6 @@ https://github.com/adafruit/circuitpython/releases * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice -""" -""" -04/19/2019 -John Turner -Added ability to call the fetch object with a URL fetch(URL) this allows the URL to be updated once pyportal is initialized - """ import os