Skip to content

Commit 4b54d7b

Browse files
committed
Black/Pylint Changes
Addressed a variable name Pylint didn't like, and ran Black.
1 parent fcba22c commit 4b54d7b

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

adafruit_vc0706.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595

9696
class VC0706:
9797
"""Driver for VC0706 serial TTL camera module.
98-
:param ~busio.UART uart: uart serial or compatible interface
99-
:param int buffer_size: Receive buffer size
98+
:param ~busio.UART uart: uart serial or compatible interface
99+
:param int buffer_size: Receive buffer size
100100
"""
101101

102102
def __init__(self, uart, *, buffer_size=100):
@@ -148,7 +148,7 @@ def baudrate(self, baud):
148148
@property
149149
def image_size(self):
150150
"""Get the current image size, will return a value of IMAGE_SIZE_640x480,
151-
IMAGE_SIZE_320x240, or IMAGE_SIZE_160x120.
151+
IMAGE_SIZE_320x240, or IMAGE_SIZE_160x120.
152152
"""
153153
if not self._run_command(_READ_DATA, b"\0x04\x04\x01\x00\x19", 6):
154154
raise RuntimeError("Failed to read image size!")
@@ -157,7 +157,7 @@ def image_size(self):
157157
@image_size.setter
158158
def image_size(self, size):
159159
"""Set the image size to a value of IMAGE_SIZE_640x480, IMAGE_SIZE_320x240, or
160-
IMAGE_SIZE_160x120.
160+
IMAGE_SIZE_160x120.
161161
"""
162162
if size not in (IMAGE_SIZE_640x480, IMAGE_SIZE_320x240, IMAGE_SIZE_160x120):
163163
raise ValueError(
@@ -170,8 +170,7 @@ def image_size(self, size):
170170

171171
@property
172172
def frame_length(self):
173-
"""Return the length in bytes of the currently capture frame/picture.
174-
"""
173+
"""Return the length in bytes of the currently capture frame/picture."""
175174
if not self._run_command(_GET_FBUF_LEN, b"\x01\x00", 9):
176175
return 0
177176
frame_length = self._buffer[5]
@@ -184,11 +183,10 @@ def frame_length(self):
184183
return frame_length
185184

186185
def take_picture(self):
187-
"""Tell the camera to take a picture. Returns True if successful.
188-
"""
186+
"""Tell the camera to take a picture. Returns True if successful."""
189187
self._frame_ptr = 0
190188
return self._run_command(_FBUF_CTRL, bytes([0x1, _STOPCURRENTFRAME]), 5)
191-
189+
192190
def resume_video(self):
193191
"""Tell the camera to resume being a camera after the video has stopped
194192
(Such as what happens when a picture is taken).

examples/vc0706_snapshot_filesystem.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
# You MUST keep the buffer size under 100!
6464
print("Writing image: {}".format(IMAGE_FILE), end="", flush=True)
6565
stamp = time.monotonic()
66+
#Pylint doesn't like the wcount variable being lowercase, but uppercase makes less sense
67+
# pylint: disable=invalid-name
6668
with open(IMAGE_FILE, "wb") as outfile:
6769
wcount = 0
6870
while frame_length > 0:
@@ -84,6 +86,7 @@
8486
print(".", end="", flush=True)
8587
wcount = 0
8688
print()
89+
# pylint: enable=invalid-name
8790
print("Finished in %0.1f seconds!" % (time.monotonic() - stamp))
88-
#Turn the camera back into video mode.
89-
vc0706.resume_video()
91+
# Turn the camera back into video mode.
92+
vc0706.resume_video()

examples/vc0706_snapshot_simpletest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
# You MUST keep the buffer size under 100!
7474
print("Writing image: {}".format(IMAGE_FILE), end="")
7575
stamp = time.monotonic()
76+
# pylint: disable=invalid-name
7677
with open(IMAGE_FILE, "wb") as outfile:
7778
wcount = 0
7879
while frame_length > 0:
@@ -92,7 +93,8 @@
9293
if wcount >= 64:
9394
print(".", end="")
9495
wcount = 0
96+
# pylint: enable=invalid-name
9597
print()
9698
print("Finished in %0.1f seconds!" % (time.monotonic() - stamp))
97-
#Turn the camera back into video mode.
98-
vc0706.resume_video()
99+
# Turn the camera back into video mode.
100+
vc0706.resume_video()

0 commit comments

Comments
 (0)