From 6291e58d58719e816d067b33432ba6572c16fc9d Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 12:37:42 -0500 Subject: [PATCH 1/7] intial fork --- CODE_OF_CONDUCT.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 134d510..762b8cc 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -127,3 +127,6 @@ Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. + + +## some add text From 48c5311f4e2f64f49012fcf4bf46cbfee8e451f8 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 13:37:10 -0500 Subject: [PATCH 2/7] refactor to match PortalBase refactor for use of secrets_data --- adafruit_pyportal/__init__.py | 4 +++- adafruit_pyportal/network.py | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/adafruit_pyportal/__init__.py b/adafruit_pyportal/__init__.py index bb432dc..17a00f1 100755 --- a/adafruit_pyportal/__init__.py +++ b/adafruit_pyportal/__init__.py @@ -128,7 +128,8 @@ def __init__( success_callback=None, esp=None, external_spi=None, - debug=False + debug=False, + secrets_data=None, ): graphics = Graphics( @@ -166,6 +167,7 @@ def __init__( image_position=image_position, image_dim_json_path=image_dim_json_path, debug=debug, + secrets_data = secrets_data ) self.url = url diff --git a/adafruit_pyportal/network.py b/adafruit_pyportal/network.py index 9f5a48a..edd8e5a 100755 --- a/adafruit_pyportal/network.py +++ b/adafruit_pyportal/network.py @@ -28,7 +28,6 @@ # pylint: disable=unused-import from adafruit_portalbase.network import ( NetworkBase, - secrets, CONTENT_JSON, CONTENT_TEXT, ) @@ -74,6 +73,7 @@ def __init__( image_resize=None, image_position=None, image_dim_json_path=None, + secrets_data = None, ): wifi = WiFi(status_neopixel=status_neopixel, esp=esp, external_spi=external_spi) @@ -81,6 +81,7 @@ def __init__( wifi, extract_values=extract_values, debug=debug, + secrets_data=secrets_data, ) self._convert_image = convert_image @@ -103,8 +104,8 @@ def image_converter_url(image_url, width, height, color_depth=16): with the given width and height. aio_username and aio_key must be set in secrets.""" try: - aio_username = secrets["aio_username"] - aio_key = secrets["aio_key"] + aio_username = self._secrets["aio_username"] + aio_key = self._secrets["aio_key"] except KeyError as error: raise KeyError( "\n\nOur image converter service require a login/password to rate-limit. Please register for a free adafruit.io account and place the user/key in your secrets file under 'aio_username' and 'aio_key'" # pylint: disable=line-too-long From dd820248db3bd17cfd78628f5d7ede90614b8fb7 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 14:21:27 -0500 Subject: [PATCH 3/7] run black --- adafruit_pyportal/__init__.py | 2 +- adafruit_pyportal/network.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_pyportal/__init__.py b/adafruit_pyportal/__init__.py index 17a00f1..3afa844 100755 --- a/adafruit_pyportal/__init__.py +++ b/adafruit_pyportal/__init__.py @@ -167,7 +167,7 @@ def __init__( image_position=image_position, image_dim_json_path=image_dim_json_path, debug=debug, - secrets_data = secrets_data + secrets_data=secrets_data, ) self.url = url diff --git a/adafruit_pyportal/network.py b/adafruit_pyportal/network.py index edd8e5a..1fb7ccd 100755 --- a/adafruit_pyportal/network.py +++ b/adafruit_pyportal/network.py @@ -73,7 +73,7 @@ def __init__( image_resize=None, image_position=None, image_dim_json_path=None, - secrets_data = None, + secrets_data=None, ): wifi = WiFi(status_neopixel=status_neopixel, esp=esp, external_spi=external_spi) From 8c0cb1622b6dfaba5e8ef160d13020abbff115cf Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 14:34:24 -0500 Subject: [PATCH 4/7] remove static method from image_converter_url --- adafruit_pyportal/network.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/adafruit_pyportal/network.py b/adafruit_pyportal/network.py index 1fb7ccd..80eed24 100755 --- a/adafruit_pyportal/network.py +++ b/adafruit_pyportal/network.py @@ -90,7 +90,7 @@ def __init__( self._image_resize = image_resize self._image_position = image_position self._image_dim_json_path = image_dim_json_path - + self._secrets = secrets_data gc.collect() @property @@ -98,8 +98,7 @@ def ip_address(self): """Return the IP Address nicely formatted""" return self._wifi.esp.pretty_ip(self._wifi.esp.ip_address) - @staticmethod - def image_converter_url(image_url, width, height, color_depth=16): + def image_converter_url(self, image_url, width, height, color_depth=16): """Generate a converted image url from the url passed in, with the given width and height. aio_username and aio_key must be set in secrets.""" From 3b37703a7682a9f192db13a99d43b6b305178f66 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 15:46:07 -0500 Subject: [PATCH 5/7] remove self._secretes = secrets from network.py --- adafruit_pyportal/network.py | 1 - 1 file changed, 1 deletion(-) diff --git a/adafruit_pyportal/network.py b/adafruit_pyportal/network.py index 80eed24..810c91e 100755 --- a/adafruit_pyportal/network.py +++ b/adafruit_pyportal/network.py @@ -90,7 +90,6 @@ def __init__( self._image_resize = image_resize self._image_position = image_position self._image_dim_json_path = image_dim_json_path - self._secrets = secrets_data gc.collect() @property From 282f1aef05ce3418fe3f46661270b62f6aca748c Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 15:51:42 -0500 Subject: [PATCH 6/7] remove erroneous lines in CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index da682e4..4e00bd3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -135,6 +135,4 @@ explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. -## some add text -======= [Contributor Covenant]: https://www.contributor-covenant.org From 241b2f0a2bd6140273f153471ba10cdbca6ee1d8 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Sat, 16 Jan 2021 15:52:50 -0500 Subject: [PATCH 7/7] remove erroneous lines in CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4e00bd3..d885b36 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -134,5 +134,4 @@ If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. - [Contributor Covenant]: https://www.contributor-covenant.org