Turning on more lint checkers, warning for cameras that ignore resolution setting
This commit is contained in:
parent
ae2ec1864f
commit
3f0564f253
3 changed files with 6 additions and 2 deletions
|
|
@ -111,8 +111,8 @@ select = [
|
||||||
# "RET", # Consistent clear return statments
|
# "RET", # Consistent clear return statments
|
||||||
"RSE", # Raise parentheses
|
"RSE", # Raise parentheses
|
||||||
# "SIM", # Simplifications detected
|
# "SIM", # Simplifications detected
|
||||||
# "ARG", # unused arguments
|
"ARG", # unused arguments
|
||||||
# "C90", # McCabe complexity!
|
"C90", # McCabe complexity!
|
||||||
"NPY", # Numpy linting
|
"NPY", # Numpy linting
|
||||||
"N", # PEP8 naming
|
"N", # PEP8 naming
|
||||||
# "DOC", # Enforce argument, return, and raise to be mentioned in docstrings there is
|
# "DOC", # Enforce argument, return, and raise to be mentioned in docstrings there is
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ class OpenCVCamera(BaseCamera):
|
||||||
It's likely to be highly inefficient - raw and/or uncompressed captures using
|
It's likely to be highly inefficient - raw and/or uncompressed captures using
|
||||||
binary image formats will be added in due course.
|
binary image formats will be added in due course.
|
||||||
"""
|
"""
|
||||||
|
logging.warning(f"OpenCV camera doen't respect {resolution} setting")
|
||||||
ret, frame = self.cap.read()
|
ret, frame = self.cap.read()
|
||||||
if not ret:
|
if not ret:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
|
@ -100,6 +101,7 @@ class OpenCVCamera(BaseCamera):
|
||||||
|
|
||||||
This function will produce a JPEG image.
|
This function will produce a JPEG image.
|
||||||
"""
|
"""
|
||||||
|
logging.warning(f"OpenCV camera doen't respect {resolution} setting")
|
||||||
frame = self.capture_array()
|
frame = self.capture_array()
|
||||||
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
|
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
|
||||||
exif_dict = {
|
exif_dict = {
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ class SimulatedCamera(BaseCamera):
|
||||||
It's likely to be highly inefficient - raw and/or uncompressed captures using
|
It's likely to be highly inefficient - raw and/or uncompressed captures using
|
||||||
binary image formats will be added in due course.
|
binary image formats will be added in due course.
|
||||||
"""
|
"""
|
||||||
|
logging.warning(f"Simulation camera doen't respect {resolution} setting")
|
||||||
return self.generate_frame()
|
return self.generate_frame()
|
||||||
|
|
||||||
@thing_action
|
@thing_action
|
||||||
|
|
@ -201,6 +202,7 @@ class SimulatedCamera(BaseCamera):
|
||||||
|
|
||||||
This function will produce a JPEG image.
|
This function will produce a JPEG image.
|
||||||
"""
|
"""
|
||||||
|
logging.warning(f"Simulation camera doen't respect {resolution} setting")
|
||||||
frame = self.capture_array()
|
frame = self.capture_array()
|
||||||
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
|
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
|
||||||
exif_dict = {
|
exif_dict = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue