Skip to content

Commit 9bdbfca

Browse files
authored
Fix line lengths, remove unneeded pylint:disable
1 parent 639dac7 commit 9bdbfca

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

adafruit_pyportal.py

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,42 @@ def json(self):
9797

9898

9999
class PyPortal:
100-
# pylint: disable=line-too-long
101100
"""Class representing the Adafruit PyPortal.
102101
103102
:param url: The URL of your data source. Defaults to ``None``.
104-
:param json_path: The list of json traversal to get data out of. Can be list of lists for multiple data points. Defaults to ``None`` to not use json.
105-
:param regexp_path: The list of regexp strings to get data out (use a single regexp group). Can be list of regexps for multiple data points. Defaults to ``None`` to not use regexp.
103+
:param json_path: The list of json traversal to get data out of. Can be list of lists for
104+
multiple data points. Defaults to ``None`` to not use json.
105+
:param regexp_path: The list of regexp strings to get data out (use a single regexp group). Can
106+
be list of regexps for multiple data points. Defaults to ``None`` to not
107+
use regexp.
106108
:param default_bg: The path to your default background image file. Defaults to ``None``.
107-
:param status_neopixel: The pin for the status NeoPixel. Use ``board.NEOPIXEL`` for the on-board NeoPixel. Defaults to ``None``, no status LED
109+
:param status_neopixel: The pin for the status NeoPixel. Use ``board.NEOPIXEL`` for the on-board
110+
NeoPixel. Defaults to ``None``, no status LED
108111
:param str text_font: The path to your font file for your data text display.
109-
:param text_position: The position of your extracted text on the display in an (x, y) tuple. Can be a list of tuples for when there's a list of json_paths, for example
110-
:param text_color: The color of the text, in 0xRRGGBB format. Can be a list of colors for when there's multiple texts. Defaults to ``None``.
111-
:param text_wrap: Whether or not to wrap text (for long text data chunks). Defaults to ``False``, no wrapping.
112+
:param text_position: The position of your extracted text on the display in an (x, y) tuple.
113+
Can be a list of tuples for when there's a list of json_paths, for example
114+
:param text_color: The color of the text, in 0xRRGGBB format. Can be a list of colors for when
115+
there's multiple texts. Defaults to ``None``.
116+
:param text_wrap: Whether or not to wrap text (for long text data chunks). Defaults to
117+
``False``, no wrapping.
112118
:param text_maxlen: The max length of the text for text wrapping. Defaults to 0.
113-
:param image_json_path: The JSON traversal path for a background image to display. Defaults to ``None``.
114-
:param image_resize: What size to resize the image we got from the json_path, make this a tuple of the width and height you want. Defaults to ``None``.
115-
:param image_position: The position of the image on the display as an (x, y) tuple. Defaults to ``None``.
116-
:param success_callback: A function we'll call if you like, when we fetch data successfully. Defaults to ``None``.
117-
:param str caption_text: The text of your caption, a fixed text not changed by the data we get. Defaults to ``None``.
119+
:param image_json_path: The JSON traversal path for a background image to display. Defaults to
120+
``None``.
121+
:param image_resize: What size to resize the image we got from the json_path, make this a tuple
122+
of the width and height you want. Defaults to ``None``.
123+
:param image_position: The position of the image on the display as an (x, y) tuple. Defaults to
124+
``None``.
125+
:param success_callback: A function we'll call if you like, when we fetch data successfully.
126+
Defaults to ``None``.
127+
:param str caption_text: The text of your caption, a fixed text not changed by the data we get.
128+
Defaults to ``None``.
118129
:param str caption_font: The path to the font file for your caption. Defaults to ``None``.
119-
:param caption_position: The position of your caption on the display as an (x, y) tuple. Defaults to ``None``.
130+
:param caption_position: The position of your caption on the display as an (x, y) tuple.
131+
Defaults to ``None``.
120132
:param caption_color: The color of your caption. Must be a hex value, e.g. ``0x808000``.
121133
:param debug: Turn on debug print outs. Defaults to False.
122134
123135
"""
124-
# pylint: enable=line-too-long
125136
# pylint: disable=too-many-instance-attributes, too-many-locals, too-many-branches, too-many-statements
126137
def __init__(self, *, url=None, json_path=None, regexp_path=None,
127138
default_bg=None, status_neopixel=None,
@@ -330,7 +341,8 @@ def preload_font(self, glyphs=None):
330341
# pylint: disable=line-too-long
331342
"""Preload font.
332343
333-
:param glyphs: The font glyphs to load. Defaults to ``None``, uses alphanumeric glyphs if None.
344+
:param glyphs: The font glyphs to load. Defaults to ``None``, uses alphanumeric glyphs if
345+
None.
334346
335347
"""
336348
# pylint: enable=line-too-long
@@ -346,7 +358,8 @@ def set_caption(self, caption_text, caption_position, caption_color):
346358
347359
:param caption_text: The text of the caption.
348360
:param caption_position: The position of the caption text.
349-
:param caption_color: The color of your caption text. Must be a hex value, e.g. ``0x808000``.
361+
:param caption_color: The color of your caption text. Must be a hex value, e.g.
362+
``0x808000``.
350363
351364
"""
352365
# pylint: enable=line-too-long
@@ -357,7 +370,7 @@ def set_caption(self, caption_text, caption_position, caption_color):
357370
return # nothing to do!
358371

359372
if self._caption:
360-
self._caption._update_text(str(caption_text)) # pylint: disable=protected-access, undefined-variable
373+
self._caption._update_text(str(caption_text)) # pylint: disable=protected-access
361374
board.DISPLAY.refresh_soon()
362375
board.DISPLAY.wait_for_frame()
363376
return
@@ -682,7 +695,7 @@ def show_QR(self, qr_data, qr_size=128, position=None): # pylint: disable=inval
682695

683696
for b in range(BLOCK_SIZE):
684697
# load this line of data in, as many time as block size
685-
qr_bitmap._load_row(Y_OFFSET + y*BLOCK_SIZE+b, line) #pylint: disable=protected-access
698+
qr_bitmap._load_row(Y_OFFSET + y*BLOCK_SIZE+b, line) # pylint: disable=protected-access
686699
# pylint: enable=invalid-name
687700

688701
# display the bitmap using our palette

0 commit comments

Comments
 (0)