From cd61ad3b21f0f6c03f0818a43194e84ebbf87ddf Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 6 Nov 2020 16:25:56 +0000 Subject: [PATCH] Formatting and linting --- .../rescue/check_capture_reload.py | 31 +++++++++++++------ .../rescue/check_picamera.py | 6 ++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/openflexure_microscope/rescue/check_capture_reload.py b/openflexure_microscope/rescue/check_capture_reload.py index 03f17748..54459665 100644 --- a/openflexure_microscope/rescue/check_capture_reload.py +++ b/openflexure_microscope/rescue/check_capture_reload.py @@ -1,7 +1,10 @@ import logging -from logging import error -from openflexure_microscope.captures.capture import build_captures_from_exif, make_file_list, EXIF_FORMATS +from openflexure_microscope.captures.capture import ( + build_captures_from_exif, + make_file_list, + EXIF_FORMATS, +) from openflexure_microscope.captures.capture_manager import BASE_CAPTURE_PATH from openflexure_microscope.config import user_settings from openflexure_microscope.rescue.monitor_timeout import launch_timeout_test_process @@ -35,17 +38,25 @@ def main(): # Check number of captures being restored files = make_file_list(cap_path, EXIF_FORMATS) if len(files) >= 10000: - error_sources.append(WarningSource( - ("Over 10000 captures are being restored. This may slow down server startup.", - f"Consider moving your captures from {cap_path} to another location.") - )) + error_sources.append( + WarningSource( + ( + "Over 10000 captures are being restored. This may slow down server startup.", + f"Consider moving your captures from {cap_path} to another location.", + ) + ) + ) # Check restore time of captures passed_timeout = check_capture_reload(cap_path) if not passed_timeout: - error_sources.append(ErrorSource( - ("Capture database rebuilding took a long time. This may not cause catastrophic errors, but rather will cause the server to hang for a while.", - f"To fix, consider moving your captures from {cap_path} to another location.") - )) + error_sources.append( + ErrorSource( + ( + "Capture database rebuilding took a long time. This may not cause catastrophic errors, but rather will cause the server to hang for a while.", + f"To fix, consider moving your captures from {cap_path} to another location.", + ) + ) + ) return error_sources diff --git a/openflexure_microscope/rescue/check_picamera.py b/openflexure_microscope/rescue/check_picamera.py index f7ddbbd7..9b21305d 100644 --- a/openflexure_microscope/rescue/check_picamera.py +++ b/openflexure_microscope/rescue/check_picamera.py @@ -3,8 +3,10 @@ import logging from .error_sources import ErrorSource picamera_import_error = ErrorSource( - ("Picamera module could not be imported.", - "Check physical connections to the camera as it may be damaged or disconnected.") + ( + "Picamera module could not be imported.", + "Check physical connections to the camera as it may be damaged or disconnected.", + ) )