Skip to content

Commit d9f988d

Browse files
committed
Suppress some Flake8 warnings
It's suddenly started complaining about these for no particular reason I understand. Signed-off-by: David Plowman <[email protected]>
1 parent f124edf commit d9f988d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

apps/app_full.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def on_pic_button_clicked():
169169

170170

171171
def on_mode_change(i):
172-
global recording
172+
global recording # noqa
173173
if recording:
174174
print("Not switching, recording in progress, so back to video")
175175
mode_tabs.setCurrentIndex(1)
@@ -207,7 +207,7 @@ def capture_done(job):
207207
switch_config("preview")
208208
else:
209209
# HDR Capture
210-
global hdr_imgs
210+
global hdr_imgs # noqa
211211
request = picam2.wait(job)
212212
new_img = request.make_array("main")
213213
new_cv_img = cv2.cvtColor(new_img, cv2.COLOR_RGB2BGR)
@@ -826,7 +826,7 @@ def __init__(self):
826826
self.layout = QFormLayout()
827827
self.setLayout(self.layout)
828828

829-
global implemented_controls, ignore_controls
829+
global implemented_controls, ignore_controls # noqa
830830
all_controls = picam2.camera_controls.keys()
831831
other_controls = []
832832
for control in all_controls:

examples/capture_circular_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def server():
32-
global circ, picam2
32+
global circ, picam2 # noqa
3333
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
3434
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
3535
sock.bind(("0.0.0.0", 10001))

examples/stereo_preview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def pre_callback(request):
1616

1717

1818
def copy_image(request):
19-
global cam2_request
19+
global cam2_request # noqa
2020
with lock:
2121
request_2 = cam2_request
2222
if request_2 is None:

examples/tensorflow/compositing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def InferenceTensorFlow(image, model, label=None):
101101

102102

103103
def capture_image_and_masks(picam2: Picamera2, model, label_file):
104-
global rectangles
104+
global rectangles # noqa
105105
picam2.post_callback = None
106106
# Disable Aec and Awb so all images have the same exposure and colour gains
107107
picam2.set_controls({"AeEnable": False, "AwbEnable": False})

examples/tensorflow/remove_background.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def main():
8787
InferenceTensorFlow(grey, args.model)
8888
base_img = np.zeros((normalSize[1], normalSize[0], 3), dtype=np.uint8)
8989
base_img = Image.fromarray(base_img)
90-
global background_mask
90+
global background_mask # noqa
9191
overlay = Image.composite(background_img, base_img, background_mask)
9292
overlay.putalpha(background_mask)
9393
overlay = np.array(overlay)

examples/tensorflow/segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def InferenceTensorFlow(image, model, colours, label=None):
8989

9090

9191
def capture_image_and_masks(picam2: Picamera2, model, colour_file, label_file):
92-
global masks
92+
global masks # noqa
9393
# Disable Aec and Awb so all images have the same exposure and colour gains
9494
picam2.set_controls({"AeEnable": False, "AwbEnable": False})
9595
time.sleep(1.0)
@@ -152,7 +152,7 @@ def main():
152152
grey = buffer[:stride * lowresSize[1]].reshape((lowresSize[1], stride))
153153
InferenceTensorFlow(grey, args.model, colour_file, label_file)
154154
overlay = np.zeros((normalSize[1], normalSize[0], 4), dtype=np.uint8)
155-
global masks
155+
global masks # noqa
156156
for v in masks.values():
157157
overlay += v
158158
# Set Alphas and overlay

0 commit comments

Comments
 (0)