Skip to content

Commit e3a2d69

Browse files
committed
pylint fixing
don't argue with the linter, marty. just make the method static, marty!
1 parent 2dd50af commit e3a2d69

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

adafruit_pyportal.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,17 +584,18 @@ def _connect_esp(self):
584584
print("Retrying in 3 seconds...")
585585
time.sleep(3)
586586

587-
def image_converter_url(self, image_url, width, height, color_depth=16):
587+
@staticmethod
588+
def image_converter_url(image_url, width, height, color_depth=16):
588589
"""Generate a converted image url from the url passed in,
589590
with the given width and height. aio_username and aio_key must be
590591
set in secrets."""
591592
try:
592-
self._aio_username = secrets['aio_username']
593-
self._aio_key = secrets['aio_key']
593+
aio_username = secrets['aio_username']
594+
aio_key = secrets['aio_key']
594595
except KeyError:
595596
raise KeyError("\n\nOur image converter service require a login/password to rate-limit. Please register for a freeadafruit.io account and place the user/key in your secrets file under 'aio_username' and 'aio_key'")# pylint: disable=line-too-long
596597

597-
return IMAGE_CONVERTER_SERVICE % (self._aio_username, self._aio_key,
598+
return IMAGE_CONVERTER_SERVICE % (aio_username, aio_key,
598599
width, height,
599600
color_depth, image_url)
600601

0 commit comments

Comments
 (0)